aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-04-24 04:00:24 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-28 03:34:53 -0400
commitd92a208d086063ecc785b4588f74ab42268cbc4b (patch)
tree07189bb010c1d9443a0fee736268cfcbf965dfd3 /drivers/pci
parent26833a5029b710b12f00607fa255ce86909836ad (diff)
powerpc/pci: Mask linkDown on resetting PCI bus
The problem was initially reported by Wendy who tried pass through IPR adapter, which was connected to PHB root port directly, to KVM based guest. When doing that, pci_reset_bridge_secondary_bus() was called by VFIO driver and linkDown was detected by the root port. That caused all PEs to be frozen. The patch fixes the issue by routing the reset for the secondary bus of root port to underly firmware. For that, one more weak function pci_reset_secondary_bus() is introduced so that the individual platforms can override that and do specific reset for bridge's secondary bus. Reported-by: Wendy Xiong <wenxiong@linux.vnet.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7325d43bf030..633382d227f4 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3167,14 +3167,7 @@ static int pci_pm_reset(struct pci_dev *dev, int probe)
3167 return 0; 3167 return 0;
3168} 3168}
3169 3169
3170/** 3170void __weak pcibios_reset_secondary_bus(struct pci_dev *dev)
3171 * pci_reset_bridge_secondary_bus - Reset the secondary bus on a PCI bridge.
3172 * @dev: Bridge device
3173 *
3174 * Use the bridge control register to assert reset on the secondary bus.
3175 * Devices on the secondary bus are left in power-on state.
3176 */
3177void pci_reset_bridge_secondary_bus(struct pci_dev *dev)
3178{ 3171{
3179 u16 ctrl; 3172 u16 ctrl;
3180 3173
@@ -3199,6 +3192,18 @@ void pci_reset_bridge_secondary_bus(struct pci_dev *dev)
3199 */ 3192 */
3200 ssleep(1); 3193 ssleep(1);
3201} 3194}
3195
3196/**
3197 * pci_reset_bridge_secondary_bus - Reset the secondary bus on a PCI bridge.
3198 * @dev: Bridge device
3199 *
3200 * Use the bridge control register to assert reset on the secondary bus.
3201 * Devices on the secondary bus are left in power-on state.
3202 */
3203void pci_reset_bridge_secondary_bus(struct pci_dev *dev)
3204{
3205 pcibios_reset_secondary_bus(dev);
3206}
3202EXPORT_SYMBOL_GPL(pci_reset_bridge_secondary_bus); 3207EXPORT_SYMBOL_GPL(pci_reset_bridge_secondary_bus);
3203 3208
3204static int pci_parent_bus_reset(struct pci_dev *dev, int probe) 3209static int pci_parent_bus_reset(struct pci_dev *dev, int probe)