[Skiboot] [PATCH 2/2] core/pci: Disable surprise hotplug on root port

Gavin Shan gwshan at linux.vnet.ibm.com
Fri Mar 10 11:25:46 AEDT 2017


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 at linux.vnet.ibm.com>
---
 core/pcie-slot.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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 */
-- 
2.7.4



More information about the Skiboot mailing list