Skip to content

Commit

Permalink
powerpc/cell: Move MSI-related ops to pci_controller_ops
Browse files Browse the repository at this point in the history
Move the Cell platform to use the pci_controller_ops structure rather
than ppc_md for MSI related PCI controller operations.

We can be confident that the functions will be added to the platform's
ops struct before any PCI controller's ops struct is populated
because:

1) These ops are added to the struct in a subsys initcall.

We populate the ops in axon_msi_probe, which is the probe call for the
axon-msi driver. However the driver is registered in axon_msi_init,
which is a subsys initcall, so this will happen at the subsys level.

2) The controller recieves the struct later, in a device initcall.

Cell populates the controller in cell_setup_phb, which is hooked up to
ppc_md.pci_setup_phb. ppc_md.pci_setup_phb is only ever called in
of_platform.c, as part of the OpenFirmware PCI driver's probe
routine. That driver is registered in a device initcall, so it will
occur *after* the struct is properly populated.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Daniel Axtens authored and Michael Ellerman committed May 22, 2015
1 parent d638111 commit 7e3d6c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/powerpc/platforms/cell/axon_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <asm/machdep.h>
#include <asm/prom.h>

#include "cell.h"

/*
* MSIC registers, specified as offsets from dcr_base
Expand Down Expand Up @@ -406,8 +407,8 @@ static int axon_msi_probe(struct platform_device *device)

dev_set_drvdata(&device->dev, msic);

ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs;
cell_pci_controller_ops.setup_msi_irqs = axon_msi_setup_msi_irqs;
cell_pci_controller_ops.teardown_msi_irqs = axon_msi_teardown_msi_irqs;

axon_msi_debug_setup(dn, msic);

Expand Down

0 comments on commit 7e3d6c5

Please sign in to comment.