diff mbox series

[2/3] PCI: Export find_pci_root_bus()

Message ID 20210920064133.14115-3-kishon@ti.com
State New
Headers show
Series PCI/gic-v3-its: Add support for same ITS device ID for multiple PCIe devices | expand

Commit Message

Kishon Vijay Abraham I Sept. 20, 2021, 6:41 a.m. UTC
Export find_pci_root_bus() in order for other subsystems (like
IRQCHIP) to find the root bus of a particual PCIe device.

This is done in preparation for GIC ITS to walk the PCIe bus for
calculating the total number of interrupt vectors that has to be
supported by a specific GIC ITS device ID, specifically when
"msi-map-mask" is populated in device tree.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/pci/host-bridge.c | 3 ++-
 include/linux/pci.h       | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Marc Zyngier Sept. 20, 2021, 8:37 a.m. UTC | #1
On Mon, 20 Sep 2021 07:41:32 +0100,
Kishon Vijay Abraham I <kishon@ti.com> wrote:
> 
> Export find_pci_root_bus() in order for other subsystems (like
> IRQCHIP) to find the root bus of a particual PCIe device.
> 
> This is done in preparation for GIC ITS to walk the PCIe bus for
> calculating the total number of interrupt vectors that has to be
> supported by a specific GIC ITS device ID, specifically when
> "msi-map-mask" is populated in device tree.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  drivers/pci/host-bridge.c | 3 ++-
>  include/linux/pci.h       | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
> index afa50b446567..4ec34d040c02 100644
> --- a/drivers/pci/host-bridge.c
> +++ b/drivers/pci/host-bridge.c
> @@ -9,13 +9,14 @@
>  
>  #include "pci.h"
>  
> -static struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
> +struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
>  {
>  	while (bus->parent)
>  		bus = bus->parent;
>  
>  	return bus;
>  }
> +EXPORT_SYMBOL_GPL(find_pci_root_bus);

There is no need for this export as the ITS cannot be made modular.

	M.
diff mbox series

Patch

diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
index afa50b446567..4ec34d040c02 100644
--- a/drivers/pci/host-bridge.c
+++ b/drivers/pci/host-bridge.c
@@ -9,13 +9,14 @@ 
 
 #include "pci.h"
 
-static struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
+struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
 {
 	while (bus->parent)
 		bus = bus->parent;
 
 	return bus;
 }
+EXPORT_SYMBOL_GPL(find_pci_root_bus);
 
 struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus)
 {
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8500fec56e50..b33ef3e08a2f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1475,6 +1475,7 @@  int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
 
 void __pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
 		    void *userdata, u32 rid, u32 mask);
+struct pci_bus *find_pci_root_bus(struct pci_bus *bus);
 int pci_cfg_space_size(struct pci_dev *dev);
 unsigned char pci_bus_max_busnr(struct pci_bus *bus);
 void pci_setup_bridge(struct pci_bus *bus);