diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2017-02-20 10:57:50 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-02-22 16:51:18 +1100 |
commit | 99343c26ac8c6e49041bd2718c8b16e5d664f8fd (patch) | |
tree | facf02e39b1a468f2f4686acaf26ac556f3d1d09 /core | |
parent | aa295110d9487d2b4b3ff31b6369bf59e1cba824 (diff) | |
download | blackbird-skiboot-99343c26ac8c6e49041bd2718c8b16e5d664f8fd.tar.gz blackbird-skiboot-99343c26ac8c6e49041bd2718c8b16e5d664f8fd.zip |
astbmc/p8dnu: Enable PCI slot's power supply on PEX9733 in hot-add path
This issue is reported from superMicro's "p8dnu" platform. PEX9733
is connected to PHB direct slot. We create dynamic PCI slots for
its (5) downstream ports and all of them support surprise hotplug
capability. The problem is power supply lost on hot-remove and it
isn't turned on automatically on hot-add. It means the PCIe link
behind the slot isn't up and the PCI adapter behind the slot can't
be probed successfully.
This fixes the issue by forcing to turn on the power supply on
hardware when user (kernel) requests to do so. Those PCI slots
are identified by additional flag (PCI_SLOT_FLAG_FORCE_POWERON).
Reported-by: Hank Chang <hankmax0000@gmail.com>
Signed-off-by: Gavin Shan <gwhsan@linux.vnet.ibm.com>
Tested-by: Willie Liauw <williel@supermicro.com.tw>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/pcie-slot.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/core/pcie-slot.c b/core/pcie-slot.c index 72068bae..e92aa8d5 100644 --- a/core/pcie-slot.c +++ b/core/pcie-slot.c @@ -227,15 +227,22 @@ static int64_t pcie_slot_set_power_state_ext(struct pci_slot *slot, uint8_t val, * only concerned in surprise hotplug path. In managed hot-add path, * the PCIe link should have been ready before we power on the slot. * However, it's not harmful to do so in managed hot-add path. + * + * When flag PCI_SLOT_FLAG_FORCE_POWERON is set for the PCI slot, we + * should turn on the slot's power supply on hardware on user's request + * because that might have been lost. Otherwise, the PCIe link behind + * the slot won't become ready for ever and PCI adapter behind the slot + * can't be probed successfully. */ if (surprise_check && slot->surprise_pluggable) { slot->power_state = val; - if (val == PCI_SLOT_POWER_ON) { + if (val == PCI_SLOT_POWER_OFF) + return OPAL_SUCCESS; + + if (!pci_slot_has_flags(slot, PCI_SLOT_FLAG_FORCE_POWERON)) { pci_slot_set_state(slot, PCI_SLOT_STATE_SPOWER_DONE); return OPAL_ASYNC_COMPLETION; } - - return OPAL_SUCCESS; } pci_slot_set_state(slot, PCI_SLOT_STATE_SPOWER_START); |