aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-03-31 01:00:47 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 06:49:14 -0400
commitcd16c7ba0cc21aa1563e4b8430519b6488d0de60 (patch)
tree53d2f175dba879e96011ea1ae31b99fcc6a0a274
parent542070baf4a0fe9de14cc2c4ca3ff1b43f14f90f (diff)
powerpc: Create pci_controller_ops.reset_secondary_bus and shim
Add pci_controller_ops.reset_secondary_bus, shadowing ppc_md.pcibios_reset_secondary_bus. Add a shim, and changes the callsites to use the shim. Use pcibios_reset_secondary_bus_shim, as both pcibios_reset_secondary_bus and pci_reset_secondary_bus are already taken. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h17
-rw-r--r--arch/powerpc/kernel/pci-common.c7
2 files changed, 18 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index ed4f8ce803bb..bb34b1eebfbe 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -34,6 +34,7 @@ struct pci_controller_ops {
34 34
35 /* Called during PCI resource reassignment */ 35 /* Called during PCI resource reassignment */
36 resource_size_t (*window_alignment)(struct pci_bus *, unsigned long type); 36 resource_size_t (*window_alignment)(struct pci_bus *, unsigned long type);
37 void (*reset_secondary_bus)(struct pci_dev *dev);
37}; 38};
38 39
39/* 40/*
@@ -346,5 +347,21 @@ static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
346 return 1; 347 return 1;
347} 348}
348 349
350static inline void pcibios_reset_secondary_bus_shim(struct pci_dev *dev)
351{
352 struct pci_controller *phb = pci_bus_to_host(dev->bus);
353
354 if (phb->controller_ops.reset_secondary_bus)
355 phb->controller_ops.reset_secondary_bus(dev);
356 else if (ppc_md.pcibios_reset_secondary_bus)
357 ppc_md.pcibios_reset_secondary_bus(dev);
358 else
359 /*
360 * Fallback to the generic function if no
361 * platform-specific one is provided
362 */
363 pci_reset_secondary_bus(dev);
364}
365
349#endif /* __KERNEL__ */ 366#endif /* __KERNEL__ */
350#endif /* _ASM_POWERPC_PCI_BRIDGE_H */ 367#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 698e0328d9c3..759eb1c87638 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -114,12 +114,7 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
114 114
115void pcibios_reset_secondary_bus(struct pci_dev *dev) 115void pcibios_reset_secondary_bus(struct pci_dev *dev)
116{ 116{
117 if (ppc_md.pcibios_reset_secondary_bus) { 117 pcibios_reset_secondary_bus_shim(dev);
118 ppc_md.pcibios_reset_secondary_bus(dev);
119 return;
120 }
121
122 pci_reset_secondary_bus(dev);
123} 118}
124 119
125static resource_size_t pcibios_io_size(const struct pci_controller *hose) 120static resource_size_t pcibios_io_size(const struct pci_controller *hose)