@@ -500,12 +500,14 @@ struct pci_slot *pcie_slot_create(struct phb *phb, struct pci_device *pd)
* Its PDC (Presence Detection Change) isn't reliable. To mark that as
* broken on them.
*/
- if (slot->slot_cap & PCICAP_EXP_SLOTCAP_HPLUG_SURP) {
- slot->surprise_pluggable = 1;
- } else if (slot->link_cap & PCICAP_EXP_LCAP_DL_ACT_REP) {
- slot->surprise_pluggable = 1;
+ if (slot->pcie_cap & PCICAP_EXP_CAP_SLOT) {
+ if (slot->slot_cap & PCICAP_EXP_SLOTCAP_HPLUG_SURP) {
+ slot->surprise_pluggable = 1;
+ } else if (slot->link_cap & PCICAP_EXP_LCAP_DL_ACT_REP) {
+ slot->surprise_pluggable = 1;
- pci_slot_add_flags(slot, PCI_SLOT_FLAG_BROKEN_PDC);
+ pci_slot_add_flags(slot, PCI_SLOT_FLAG_BROKEN_PDC);
+ }
}
/* Standard slot operations */
We are creating PCI slot on root port, where the PCI slot isn't supported from hardware. For this case, the surprised hotplug functionality shouldn't be enabled even the link state change reporting is supported in hardware. This disables surprise hotplug if PCI slot isn't supported in hardware. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> --- core/pcie-slot.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)