2021-04-22 17:09:02

by Kunihiko Hayashi

[permalink] [raw]
Subject: [PATCH v11 0/3] PCI: uniphier: Add PME/AER support for UniPhier PCIe host controller

This adds a new function called by MSI handler in DesignWare PCIe framework,
that invokes PME and AER funcions to detect the factor from SoC-dependent
registers.

Changes since v10:
- Fix comment style in the header
- Fix "virq" and "vIRQ" in variable name and description to "irq" and "IRQ"

Changes since v9:
- Fix the description of pcie_prot_service_get_irq()

Changes since v8:
- Add uniphier_pcie_host_init_complete() that finds PME/AER IRQ number
after calling dw_pcie_host_init()
- Add conditions to depend on CONFIG_PCIE_PME and CONFIG_PCIEAER instead
of CONFIG_PCIEPORTBUS
- Add Acked-by: line to portdrv patch

Changes since v7:
- Add Reviewed-by: line to 1st and 3rd patches

Changes since v6:
- Separate patches for iATU and phy error from this series
- Add Reviewed-by: line to dwc patch

Changes since v5:
- Add pcie_port_service_get_irq() function to pcie/portdrv
- Call pcie_port_service_get_irq() to get IRQ interrupt number for PME/AER
- Rebase to the latest linux-next branch,
and remove devm_platform_ioremap_resource_byname() replacement patch

Changes since v4:
- Add Acked-by: line to dwc patch

Changes since v3:
- Move msi_host_isr() call into dw_handle_msi_irq()
- Move uniphier_pcie_misc_isr() call into the guard of chained_irq
- Use a bool argument is_msi instead of pci_msi_enabled()
- Consolidate handler calls for the same interrupt
- Fix typos in commit messages

Changes since v2:
- Avoid printing phy error message in case of EPROBE_DEFER
- Fix iATU register mapping method
- dt-bindings: Add Acked-by: line
- Fix typos in commit messages
- Use devm_platform_ioremap_resource_byname()

Changes since v1:
- Add check if struct resource is NULL
- Fix warning in the type of dev_err() argument

Kunihiko Hayashi (3):
PCI: portdrv: Add pcie_port_service_get_irq() function
PCI: dwc: Add msi_host_isr() callback
PCI: uniphier: Add misc interrupt handler to invoke PME and AER

drivers/pci/controller/dwc/pcie-designware-host.c | 3 +
drivers/pci/controller/dwc/pcie-designware.h | 1 +
drivers/pci/controller/dwc/pcie-uniphier.c | 105 +++++++++++++++++++---
drivers/pci/pcie/portdrv.h | 1 +
drivers/pci/pcie/portdrv_core.c | 16 ++++
5 files changed, 112 insertions(+), 14 deletions(-)

--
2.7.4


2021-04-22 17:10:02

by Kunihiko Hayashi

[permalink] [raw]
Subject: [PATCH v11 1/3] PCI: portdrv: Add pcie_port_service_get_irq() function

Add pcie_port_service_get_irq() that returns the virtual IRQ number
for specified portdrv service.

Cc: Lorenzo Pieralisi <[email protected]>
Signed-off-by: Kunihiko Hayashi <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
---
drivers/pci/pcie/portdrv.h | 1 +
drivers/pci/pcie/portdrv_core.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+)

diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
index 2ff5724..628a3de 100644
--- a/drivers/pci/pcie/portdrv.h
+++ b/drivers/pci/pcie/portdrv.h
@@ -144,4 +144,5 @@ static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {}
#endif /* !CONFIG_PCIE_PME */

struct device *pcie_port_find_device(struct pci_dev *dev, u32 service);
+int pcie_port_service_get_irq(struct pci_dev *dev, u32 service);
#endif /* _PORTDRV_H_ */
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index e1fed664..93027d3 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -478,6 +478,22 @@ struct device *pcie_port_find_device(struct pci_dev *dev,
EXPORT_SYMBOL_GPL(pcie_port_find_device);

/**
+ * pcie_port_service_get_irq - get irq of the service
+ * @dev: PCI Express port the service is associated with
+ * @service: For the service to find
+ *
+ * Get irq number associated with given service on a pci_dev
+ */
+int pcie_port_service_get_irq(struct pci_dev *dev, u32 service)
+{
+ struct pcie_device *pciedev;
+
+ pciedev = to_pcie_device(pcie_port_find_device(dev, service));
+
+ return pciedev->irq;
+}
+
+/**
* pcie_port_device_remove - unregister PCI Express port service devices
* @dev: PCI Express port the service devices to unregister are associated with
*
--
2.7.4

2021-05-19 19:10:34

by Kunihiko Hayashi

[permalink] [raw]
Subject: Re: [PATCH v11 0/3] PCI: uniphier: Add PME/AER support for UniPhier PCIe host controller

Gentle Ping.
Are there any comments about this series?

Thank you,


On 2021/04/23 2:04, Kunihiko Hayashi wrote:
> This adds a new function called by MSI handler in DesignWare PCIe framework,
> that invokes PME and AER funcions to detect the factor from SoC-dependent
> registers.
>
> Changes since v10:
> - Fix comment style in the header
> - Fix "virq" and "vIRQ" in variable name and description to "irq" and "IRQ"
>
> Changes since v9:
> - Fix the description of pcie_prot_service_get_irq()
>
> Changes since v8:
> - Add uniphier_pcie_host_init_complete() that finds PME/AER IRQ number
> after calling dw_pcie_host_init()
> - Add conditions to depend on CONFIG_PCIE_PME and CONFIG_PCIEAER instead
> of CONFIG_PCIEPORTBUS
> - Add Acked-by: line to portdrv patch
>
> Changes since v7:
> - Add Reviewed-by: line to 1st and 3rd patches
>
> Changes since v6:
> - Separate patches for iATU and phy error from this series
> - Add Reviewed-by: line to dwc patch
>
> Changes since v5:
> - Add pcie_port_service_get_irq() function to pcie/portdrv
> - Call pcie_port_service_get_irq() to get IRQ interrupt number for PME/AER
> - Rebase to the latest linux-next branch,
> and remove devm_platform_ioremap_resource_byname() replacement patch
>
> Changes since v4:
> - Add Acked-by: line to dwc patch
>
> Changes since v3:
> - Move msi_host_isr() call into dw_handle_msi_irq()
> - Move uniphier_pcie_misc_isr() call into the guard of chained_irq
> - Use a bool argument is_msi instead of pci_msi_enabled()
> - Consolidate handler calls for the same interrupt
> - Fix typos in commit messages
>
> Changes since v2:
> - Avoid printing phy error message in case of EPROBE_DEFER
> - Fix iATU register mapping method
> - dt-bindings: Add Acked-by: line
> - Fix typos in commit messages
> - Use devm_platform_ioremap_resource_byname()
>
> Changes since v1:
> - Add check if struct resource is NULL
> - Fix warning in the type of dev_err() argument
>
> Kunihiko Hayashi (3):
> PCI: portdrv: Add pcie_port_service_get_irq() function
> PCI: dwc: Add msi_host_isr() callback
> PCI: uniphier: Add misc interrupt handler to invoke PME and AER
>
> drivers/pci/controller/dwc/pcie-designware-host.c | 3 +
> drivers/pci/controller/dwc/pcie-designware.h | 1 +
> drivers/pci/controller/dwc/pcie-uniphier.c | 105 +++++++++++++++++++---
> drivers/pci/pcie/portdrv.h | 1 +
> drivers/pci/pcie/portdrv_core.c | 16 ++++
> 5 files changed, 112 insertions(+), 14 deletions(-)
>

--
---
Best Regards
Kunihiko Hayashi