diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-10-14 15:26:05 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-10-17 10:33:56 +1100 |
commit | 51931bad325e3feba934eaf95b422deeb24cf4e5 (patch) | |
tree | 984642f7ee72a5146c187fbbd24f7432e0a05299 /platforms/ibm-fsp | |
parent | 481ad7330e332770b1dcd2c9f56d0a2caac67755 (diff) | |
download | blackbird-skiboot-51931bad325e3feba934eaf95b422deeb24cf4e5.tar.gz blackbird-skiboot-51931bad325e3feba934eaf95b422deeb24cf4e5.zip |
core/pci: Claim surprise hotplug capability
This claims PCIe surprise hotplug capability through device node's
property "ibm,slot-surprise-pluggable". The slot has the capability
when surprise hotplug is supported in its slot's capability bits or
link state change reporting is supported in PCIe link capability bits.
In order for link state events to be properly raised during surprise
hotplug, the power supply to the slot should be always on. The slot's
power state should be switched accordingly during fundamental reset.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms/ibm-fsp')
-rw-r--r-- | platforms/ibm-fsp/firenze-pci.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c index 1d834091..2b8c0c69 100644 --- a/platforms/ibm-fsp/firenze-pci.c +++ b/platforms/ibm-fsp/firenze-pci.c @@ -653,6 +653,16 @@ static int64_t firenze_pci_slot_set_power_state(struct pci_slot *slot, if (slot->power_state == val) return OPAL_SUCCESS; + /* Update with the requested power state and bail immediately when + * surprise hotplug is supported on the slot. It keeps the power + * supply to the slot on and it guarentees the link state change + * events will be raised properly during surprise hot add/remove. + */ + if (slot->surprise_pluggable) { + slot->power_state = val; + return OPAL_SUCCESS; + } + slot->power_state = val; pci_slot_set_state(slot, FIRENZE_PCI_SLOT_SPOWER_START); |