mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans Zhang <hans.zhang@cixtech.com>
To: Richard Zhu <hongxing.zhu@nxp.com>,
	frank.li@nxp.com, Zhiqiang.Hou@nxp.com, bhelgaas@google.com,
	ilpo.jarvinen@linux.intel.com, Jonthan.Cameron@huawei.com,
	lukas@wunner.de, feng.tang@linux.alibaba.com,
	jingoohan1@gmail.com, mani@kernel.org, lpieralisi@kernel.org,
	kwilczynski@kernel.org, robh@kernel.org
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev
Subject: Re: [PATCH v1 2/2] PCI: dwc: Fetch dedicated AER/PME interrupters
Date: Thu, 7 Aug 2025 15:21:28 +0800	[thread overview]
Message-ID: <2f501b15-bea3-4893-b218-ca96ff1e0561@cixtech.com> (raw)
In-Reply-To: <20250807070917.2245463-3-hongxing.zhu@nxp.com>



On 2025/8/7 15:09, Richard Zhu wrote:
> EXTERNAL EMAIL
> 
> Some PCI host bridges have limitation that AER/PME can't work over MSI.
> Vendors route the AER/PME via the dedicated SPI interrupter which is
> only handled by the controller driver.
> 
> Because that aer and pme had been defined in the snps,dw-pcie.yaml
> document. Fetch the vendor specific AER/PME interrupters if they are
> defined in the fdt file by generic bridge->get_service_irqs hook.
> 
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>   .../pci/controller/dwc/pcie-designware-host.c | 32 +++++++++++++++++++
>   1 file changed, 32 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index 906277f9ffaf7..9393dc99df81f 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -13,11 +13,13 @@
>   #include <linux/irqdomain.h>
>   #include <linux/msi.h>
>   #include <linux/of_address.h>
> +#include <linux/of_irq.h>
>   #include <linux/of_pci.h>
>   #include <linux/pci_regs.h>
>   #include <linux/platform_device.h>
> 
>   #include "../../pci.h"
> +#include "../../pcie/portdrv.h"
>   #include "pcie-designware.h"
> 
>   static struct pci_ops dw_pcie_ops;
> @@ -461,6 +463,35 @@ static int dw_pcie_host_get_resources(struct dw_pcie_rp *pp)
>          return 0;
>   }
> 
> +static int dw_pcie_get_service_irqs(struct pci_host_bridge *bridge,
> +                                   int *irqs, int mask)
> +{
> +       struct device *dev = bridge->dev.parent;
> +       struct device_node *np = dev->of_node;
> +       int ret, count = 0;
> +
> +       if (!np)
> +               return 0;
> +
> +       if (mask & PCIE_PORT_SERVICE_AER) {
> +               ret = of_irq_get_byname(np, "aer");
> +               if (ret > 0) {
> +                       irqs[PCIE_PORT_SERVICE_AER_SHIFT] = ret;
> +                       count++;
> +               }
> +       }
> +
> +       if (mask & PCIE_PORT_SERVICE_PME) {
> +               ret = of_irq_get_byname(np, "pme");
> +               if (ret > 0) {
> +                       irqs[PCIE_PORT_SERVICE_PME_SHIFT] = ret;
> +                       count++;
> +               }
> +       }
> +

Hi Richard,

As far as I know, some SoCs directly use the misc SPI interrupt derived 
from Synopsys PCIe IP. This includes PME, AER and other interrupts. So 
here, can we assign the interrupt number ourselves?

Also, whether to trigger the AER/PME interrupt in a similar way. 
(generic_handle_domain_irq)
Because there may be a misc SPI interrupt that requires a clear related 
state, what is referred to here is not the AER/PME state.

Best regards,
Hans


> +       return count;
> +}
> +
>   int dw_pcie_host_init(struct dw_pcie_rp *pp)
>   {
>          struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
> @@ -476,6 +507,7 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
>                  return -ENOMEM;
> 
>          pp->bridge = bridge;
> +       pp->bridge->get_service_irqs = dw_pcie_get_service_irqs;
> 
>          ret = dw_pcie_host_get_resources(pp);
>          if (ret)
> --
> 2.37.1
> 
> 

      parent reply	other threads:[~2025-08-07  7:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07  7:09 [PATCH v1 0/2] " Richard Zhu
2025-08-07  7:09 ` [PATCH v1 1/2] PCI/portdrv: Use get_service_irqs() callback to get PME/AER irqs Richard Zhu
2025-08-07  7:09 ` [PATCH v1 2/2] PCI: dwc: Fetch dedicated AER/PME interrupters Richard Zhu
2025-08-07  7:21   ` Hans Zhang
2025-08-07  7:38     ` Hongxing Zhu
2025-08-07  8:33       ` mani
2025-08-07  7:21   ` Hans Zhang [this message]

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=2f501b15-bea3-4893-b218-ca96ff1e0561@cixtech.com \
    --to=hans.zhang@cixtech.com \
    --cc=Jonthan.Cameron@huawei.com \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=feng.tang@linux.alibaba.com \
    --cc=frank.li@nxp.com \
    --cc=hongxing.zhu@nxp.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=imx@lists.linux.dev \
    --cc=jingoohan1@gmail.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=lukas@wunner.de \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®