Commit 786e5b10 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Michael Ellerman

powerpc/pseries/pci: Introduce __find_pe_total_msi()

It will help to size the PCI MSI domain.
Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210701132750.1475580-2-clg@kaod.org
parent 2ac78e0c
...@@ -164,12 +164,12 @@ static int check_req_msix(struct pci_dev *pdev, int nvec) ...@@ -164,12 +164,12 @@ static int check_req_msix(struct pci_dev *pdev, int nvec)
/* Quota calculation */ /* Quota calculation */
static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total) static struct device_node *__find_pe_total_msi(struct device_node *node, int *total)
{ {
struct device_node *dn; struct device_node *dn;
const __be32 *p; const __be32 *p;
dn = of_node_get(pci_device_to_OF_node(dev)); dn = of_node_get(node);
while (dn) { while (dn) {
p = of_get_property(dn, "ibm,pe-total-#msi", NULL); p = of_get_property(dn, "ibm,pe-total-#msi", NULL);
if (p) { if (p) {
...@@ -185,6 +185,11 @@ static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total) ...@@ -185,6 +185,11 @@ static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total)
return NULL; return NULL;
} }
static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total)
{
return __find_pe_total_msi(pci_device_to_OF_node(dev), total);
}
static struct device_node *find_pe_dn(struct pci_dev *dev, int *total) static struct device_node *find_pe_dn(struct pci_dev *dev, int *total)
{ {
struct device_node *dn; struct device_node *dn;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment