aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2016-08-05 23:23:48 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2016-08-05 23:23:48 +0000
commita1566487dbabe857bb5e7e24c6fa2153441b6b95 (patch)
tree71a8c797ff80df8d8169480e553bdcc68c554f83 /sys/dev
parentf1c1f188f7601247dac38f5e4f262337904c4bda (diff)
downloadsrc-a1566487dbabe857bb5e7e24c6fa2153441b6b95.tar.gz
src-a1566487dbabe857bb5e7e24c6fa2153441b6b95.zip
Fix some logic in PCIe HotPlug; display EI status
The interpretation of the Electromechanical Interlock Status was inverted, so we disengaged the EI if a card was inserted. Fix it to engage the EI if a card is inserted. When displaying the slot capabilites/status with pciconf: - We inverted the sense of the Power Controller Control bit, saying the power was off when it was really on (according to this bit). Fix that. - Display the status of the Electromechanical Interlock: EI(engaged) EI(disengaged) Reviewed by: jhb MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7426
Notes
Notes: svn path=/head/; revision=303788
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pci_pci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index 13d1b726a32f..6e8d076d2cad 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -1057,7 +1057,7 @@ static void
pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask,
bool schedule_task)
{
- bool card_inserted;
+ bool card_inserted, ei_engaged;
/* Clear DETACHING if Present Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
@@ -1094,8 +1094,8 @@ pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask,
*/
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) {
mask |= PCIEM_SLOT_CTL_EIC;
- if (card_inserted !=
- !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS))
+ ei_engaged = (sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) != 0;
+ if (card_inserted != ei_engaged)
val |= PCIEM_SLOT_CTL_EIC;
}
@@ -1122,7 +1122,7 @@ pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask,
pcib_pcie_hotplug_command(sc, val, mask);
/*
- * During attach the child "pci" device is added sychronously;
+ * During attach the child "pci" device is added synchronously;
* otherwise, the task is scheduled to manage the child
* device.
*/