Commit 1d14b875 authored by Daniel Axtens's avatar Daniel Axtens Committed by Michael Ellerman

powerpc/pseries: Move MSI-related ops to pci_controller_ops

Move the pseries platform to use the pci_controller_ops structure
rather than ppc_md for MSI related PCI controller operations

We need to iterate all PHBs because the MSI setup happens later than
find_and_init_phbs() - mpe.
Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7e3d6c5a
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <asm/ppc-pci.h> #include <asm/ppc-pci.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include "pseries.h"
static int query_token, change_token; static int query_token, change_token;
#define RTAS_QUERY_FN 0 #define RTAS_QUERY_FN 0
...@@ -505,6 +507,8 @@ static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) ...@@ -505,6 +507,8 @@ static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
static int rtas_msi_init(void) static int rtas_msi_init(void)
{ {
struct pci_controller *phb;
query_token = rtas_token("ibm,query-interrupt-source-number"); query_token = rtas_token("ibm,query-interrupt-source-number");
change_token = rtas_token("ibm,change-msi"); change_token = rtas_token("ibm,change-msi");
...@@ -516,9 +520,15 @@ static int rtas_msi_init(void) ...@@ -516,9 +520,15 @@ static int rtas_msi_init(void)
pr_debug("rtas_msi: Registering RTAS MSI callbacks.\n"); pr_debug("rtas_msi: Registering RTAS MSI callbacks.\n");
WARN_ON(ppc_md.setup_msi_irqs); WARN_ON(pseries_pci_controller_ops.setup_msi_irqs);
ppc_md.setup_msi_irqs = rtas_setup_msi_irqs; pseries_pci_controller_ops.setup_msi_irqs = rtas_setup_msi_irqs;
ppc_md.teardown_msi_irqs = rtas_teardown_msi_irqs; pseries_pci_controller_ops.teardown_msi_irqs = rtas_teardown_msi_irqs;
list_for_each_entry(phb, &hose_list, list_node) {
WARN_ON(phb->controller_ops.setup_msi_irqs);
phb->controller_ops.setup_msi_irqs = rtas_setup_msi_irqs;
phb->controller_ops.teardown_msi_irqs = rtas_teardown_msi_irqs;
}
WARN_ON(ppc_md.pci_irq_fixup); WARN_ON(ppc_md.pci_irq_fixup);
ppc_md.pci_irq_fixup = rtas_msi_pci_irq_fixup; ppc_md.pci_irq_fixup = rtas_msi_pci_irq_fixup;
......
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