aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-02-20 10:57:46 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-02-22 17:05:14 +1100
commitaf4f68a34484e50857d7bfbe6f9c2141839dd4fb (patch)
tree260aa446ea51d144cabc5903e48bb82254caf680 /core
parent5b6a8bc7d456332f74e3f3822013940273dad4e1 (diff)
downloadskiboot-af4f68a34484e50857d7bfbe6f9c2141839dd4fb.zip
skiboot-af4f68a34484e50857d7bfbe6f9c2141839dd4fb.tar.gz
skiboot-af4f68a34484e50857d7bfbe6f9c2141839dd4fb.tar.bz2
core/pci: More reliable way to update PCI slot power state
The power control bit (SLOT_CTL, offset: PCIe cap + 0x18) isn't reliable enough to reflect the PCI slot's power state. Instead, the power indication bits are more reliable comparatively. This leads to mismatch between the cached power state and PCI slot's presence state, resulting in the hotplug driver in kernel refuses to unplug the devices properly on the request. The issue was found on below NVMe card on "supermicro,p8dtu2u" machine. We don't have this issue on the integrated PLX 8718 switch. # lspci 0022:01:00.0 PCI bridge: PLX Technology, Inc. PEX 9733 33-lane, \ 9-port PCI Express Gen 3 (8.0 GT/s) Switch (rev aa) 0022:02:01.0 PCI bridge: PLX Technology, Inc. PEX 9733 33-lane, \ 9-port PCI Express Gen 3 (8.0 GT/s) Switch (rev aa) 0022:02:04.0 PCI bridge: PLX Technology, Inc. PEX 9733 33-lane, \ 9-port PCI Express Gen 3 (8.0 GT/s) Switch (rev aa) 0022:02:05.0 PCI bridge: PLX Technology, Inc. PEX 9733 33-lane, \ 9-port PCI Express Gen 3 (8.0 GT/s) Switch (rev aa) 0022:02:06.0 PCI bridge: PLX Technology, Inc. PEX 9733 33-lane, \ 9-port PCI Express Gen 3 (8.0 GT/s) Switch (rev aa) 0022:02:07.0 PCI bridge: PLX Technology, Inc. PEX 9733 33-lane, \ 9-port PCI Express Gen 3 (8.0 GT/s) Switch (rev aa) 0022:17:00.0 Non-Volatile memory controller: Device 19e5:0123 (rev 45) This updates the cached PCI slot's power state using the power indication bits instead of power control bit, to fix above issue. Cc: stable #5.4.0+ Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit b03d75da4a7f1211e59166115ec66d1dd674fbad) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/pcie-slot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pcie-slot.c b/core/pcie-slot.c
index 11354ed..eb8a02c 100644
--- a/core/pcie-slot.c
+++ b/core/pcie-slot.c
@@ -454,7 +454,7 @@ struct pci_slot *pcie_slot_create(struct phb *phb, struct pci_device *pd)
if (pd && ecap) {
pci_cfg_read16(phb, pd->bdfn,
ecap + PCICAP_EXP_SLOTCTL, &slot_ctl);
- if (slot_ctl & PCICAP_EXP_SLOTCTL_PWRCTLR)
+ if (((slot_ctl & PCICAP_EXP_SLOTCTL_PWRI) >> 8) == PCIE_INDIC_OFF)
slot->power_state = PCI_SLOT_POWER_OFF;
}
}