From: Jon Hunter <jonathanh@nvidia.com>
To: Radu Rendec <rrendec@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Manivannan Sadhasivam <mani@kernel.org>
Cc: "Daniel Tsai" <danielsftsai@google.com>,
"Marek Behún" <kabel@kernel.org>,
"Krishna Chaitanya Chundru" <quic_krichai@quicinc.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Brian Masney" <bmasney@redhat.com>,
"Eric Chanudet" <echanude@redhat.com>,
"Alessandro Carminati" <acarmina@redhat.com>,
"Jared Kangas" <jkangas@redhat.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] PCI: dwc: Enable MSI affinity support
Date: Tue, 20 Jan 2026 18:01:59 +0000 [thread overview]
Message-ID: <4e5b349c-6599-4871-9e3b-e10352ae0ca0@nvidia.com> (raw)
In-Reply-To: <20251128212055.1409093-4-rrendec@redhat.com>
Hi Radu,
On 28/11/2025 21:20, Radu Rendec wrote:
> Leverage the interrupt redirection infrastructure to enable CPU affinity
> support for MSI interrupts. Since the parent interrupt affinity cannot
> be changed, affinity control for the child interrupt (MSI) is achieved
> by redirecting the handler to run in IRQ work context on the target CPU.
>
> This patch was originally prepared by Thomas Gleixner (see Link tag
> below) in a patch series that was never submitted as is, and only
> parts of that series have made it upstream so far.
>
> Originally-by: Thomas Gleixner <tglx@linutronix.de>
> Link: https://lore.kernel.org/linux-pci/878qpg4o4t.ffs@tglx/
> Signed-off-by: Radu Rendec <rrendec@redhat.com>
> ---
> .../pci/controller/dwc/pcie-designware-host.c | 33 ++++++++++++++++---
> 1 file changed, 28 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index aa93acaa579a5..90d9cb45e7842 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -26,9 +26,27 @@ static struct pci_ops dw_pcie_ops;
> static struct pci_ops dw_pcie_ecam_ops;
> static struct pci_ops dw_child_pcie_ops;
>
> +#ifdef CONFIG_SMP
> +static void dw_irq_noop(struct irq_data *d) { }
> +#endif
> +
> +static bool dw_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
> + struct irq_domain *real_parent, struct msi_domain_info *info)
> +{
> + if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
> + return false;
> +
> +#ifdef CONFIG_SMP
> + info->chip->irq_ack = dw_irq_noop;
> + info->chip->irq_pre_redirect = irq_chip_pre_redirect_parent;
> +#else
> + info->chip->irq_ack = irq_chip_ack_parent;
> +#endif
> + return true;
> +}
> +
> #define DW_PCIE_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
> MSI_FLAG_USE_DEF_CHIP_OPS | \
> - MSI_FLAG_NO_AFFINITY | \
> MSI_FLAG_PCI_MSI_MASK_PARENT)
> #define DW_PCIE_MSI_FLAGS_SUPPORTED (MSI_FLAG_MULTI_PCI_MSI | \
> MSI_FLAG_PCI_MSIX | \
> @@ -40,9 +58,8 @@ static const struct msi_parent_ops dw_pcie_msi_parent_ops = {
> .required_flags = DW_PCIE_MSI_FLAGS_REQUIRED,
> .supported_flags = DW_PCIE_MSI_FLAGS_SUPPORTED,
> .bus_select_token = DOMAIN_BUS_PCI_MSI,
> - .chip_flags = MSI_CHIP_FLAG_SET_ACK,
> .prefix = "DW-",
> - .init_dev_msi_info = msi_lib_init_dev_msi_info,
> + .init_dev_msi_info = dw_pcie_init_dev_msi_info,
> };
>
> /* MSI int handler */
> @@ -63,7 +80,7 @@ void dw_handle_msi_irq(struct dw_pcie_rp *pp)
> continue;
>
> for_each_set_bit(pos, &status, MAX_MSI_IRQS_PER_CTRL)
> - generic_handle_domain_irq(pp->irq_domain, irq_off + pos);
> + generic_handle_demux_domain_irq(pp->irq_domain, irq_off + pos);
> }
> }
>
> @@ -140,10 +157,16 @@ static void dw_pci_bottom_ack(struct irq_data *d)
>
> static struct irq_chip dw_pci_msi_bottom_irq_chip = {
> .name = "DWPCI-MSI",
> - .irq_ack = dw_pci_bottom_ack,
> .irq_compose_msi_msg = dw_pci_setup_msi_msg,
> .irq_mask = dw_pci_bottom_mask,
> .irq_unmask = dw_pci_bottom_unmask,
> +#ifdef CONFIG_SMP
> + .irq_ack = dw_irq_noop,
> + .irq_pre_redirect = dw_pci_bottom_ack,
> + .irq_set_affinity = irq_chip_redirect_set_affinity,
> +#else
> + .irq_ack = dw_pci_bottom_ack,
> +#endif
> };
>
> static int dw_pcie_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
I am seeing another issue with this patch. On the Tegra194 AGX Xavier
platform suspend is failing and reverting this patch fixes the problem.
Unfortunately the logs don't tell me much. In a bad case I see ...
PM: suspend entry (deep)
Filesystems sync: 0.000 seconds
Freezing user space processes
Freezing user space processes completed (elapsed 0.002 seconds)
OOM killer disabled.
Freezing remaining freezable tasks
Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
tegra-xusb 3610000.usb: Firmware timestamp: 2020-09-11 16:55:03 UTC
dwc-eth-dwmac 2490000.ethernet eth0: Link is Down
tegra194-pcie 14100000.pcie: Link didn't transition to L2 state
Disabling non-boot CPUs ...
It appears to hang here. In a good case I see ...
PM: suspend entry (deep)
Filesystems sync: 0.000 seconds
Freezing user space processes
Freezing user space processes completed (elapsed 0.002 seconds)
OOM killer disabled.
Freezing remaining freezable tasks
Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
tegra-xusb 3610000.usb: Firmware timestamp: 2020-09-11 16:55:03 UTC
dwc-eth-dwmac 2490000.ethernet eth0: Link is Down
tegra194-pcie 14100000.pcie: Link didn't transition to L2 state
Disabling non-boot CPUs ...
psci: CPU7 killed (polled 0 ms)
psci: CPU6 killed (polled 4 ms)
psci: CPU5 killed (polled 0 ms)
psci: CPU4 killed (polled 4 ms)
psci: CPU3 killed (polled 4 ms)
psci: CPU2 killed (polled 0 ms)
psci: CPU1 killed (polled 0 ms)
...
Enabling non-boot CPUs ... (resume starts)
So it looks like it is hanging when disabling the non-boot CPUs. So far
it only appears to happen on Tegra194.
Let me know if you have any suggestions.
Thanks
Jon
--
nvpublic
next prev parent reply other threads:[~2026-01-20 18:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251128212055.1409093-1-rrendec@redhat.com>
[not found] ` <20251128212055.1409093-4-rrendec@redhat.com>
[not found] ` <176583448396.510.10427292538118156779.tip-bot2@tip-bot2>
2026-01-06 9:53 ` [tip: irq/msi] PCI: dwc: Enable MSI affinity support Jon Hunter
2026-01-06 15:07 ` Radu Rendec
2026-01-07 1:13 ` Radu Rendec
2026-01-20 18:01 ` Jon Hunter [this message]
2026-01-20 22:30 ` [PATCH v3 3/3] " Radu Rendec
2026-01-21 14:00 ` Jon Hunter
2026-01-22 23:31 ` Radu Rendec
2026-01-23 13:25 ` Jon Hunter
2026-01-26 7:59 ` Thomas Gleixner
2026-01-26 22:07 ` Jon Hunter
2026-01-26 22:26 ` Radu Rendec
2026-01-27 10:30 ` Thomas Gleixner
2026-01-27 13:34 ` Thomas Gleixner
2026-01-27 17:09 ` Jon Hunter
2026-01-27 21:30 ` [PATCH] genirq/redirect: Prevent writing MSI message on affinity change Thomas Gleixner
2026-03-26 3:48 ` [PATCH v3 3/3] PCI: dwc: Enable MSI affinity support Tsai Sung-Fu
2026-03-26 12:52 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e5b349c-6599-4871-9e3b-e10352ae0ca0@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=acarmina@redhat.com \
--cc=bhelgaas@google.com \
--cc=bmasney@redhat.com \
--cc=danielsftsai@google.com \
--cc=echanude@redhat.com \
--cc=jingoohan1@gmail.com \
--cc=jkangas@redhat.com \
--cc=kabel@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=quic_krichai@quicinc.com \
--cc=robh@kernel.org \
--cc=rrendec@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox