From 7c4a326bea502fc1f3b8b767f6ff9c02b7d1b254 Mon Sep 17 00:00:00 2001 From: Gavin Shan Date: Fri, 10 Mar 2017 11:25:46 +1100 Subject: core/pci: Disable surprise hotplug on root port 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 Signed-off-by: Stewart Smith --- core/pcie-slot.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/pcie-slot.c b/core/pcie-slot.c index aca59dd..022668a 100644 --- a/core/pcie-slot.c +++ b/core/pcie-slot.c @@ -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 */ -- cgit v1.1