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: Daniel Axtens <dja@axtens.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
7e3d6c5a4b
commit
1d14b8755f
|
@ -18,6 +18,8 @@
|
|||
#include <asm/ppc-pci.h>
|
||||
#include <asm/machdep.h>
|
||||
|
||||
#include "pseries.h"
|
||||
|
||||
static int query_token, change_token;
|
||||
|
||||
#define RTAS_QUERY_FN 0
|
||||
|
@ -505,6 +507,8 @@ static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
|
|||
|
||||
static int rtas_msi_init(void)
|
||||
{
|
||||
struct pci_controller *phb;
|
||||
|
||||
query_token = rtas_token("ibm,query-interrupt-source-number");
|
||||
change_token = rtas_token("ibm,change-msi");
|
||||
|
||||
|
@ -516,9 +520,15 @@ static int rtas_msi_init(void)
|
|||
|
||||
pr_debug("rtas_msi: Registering RTAS MSI callbacks.\n");
|
||||
|
||||
WARN_ON(ppc_md.setup_msi_irqs);
|
||||
ppc_md.setup_msi_irqs = rtas_setup_msi_irqs;
|
||||
ppc_md.teardown_msi_irqs = rtas_teardown_msi_irqs;
|
||||
WARN_ON(pseries_pci_controller_ops.setup_msi_irqs);
|
||||
pseries_pci_controller_ops.setup_msi_irqs = rtas_setup_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);
|
||||
ppc_md.pci_irq_fixup = rtas_msi_pci_irq_fixup;
|
||||
|
|
Loading…
Reference in New Issue