diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-03-18 17:10:54 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-03-28 15:24:12 +1100 |
commit | 99937b9438458967ab205b37854d6c469990162b (patch) | |
tree | dff9ae66bc2d3922f17ff9059f7f33c244aedd46 | |
parent | 14372fc9fb60601b9103bf08066c3391e3269676 (diff) | |
download | skiboot-99937b9438458967ab205b37854d6c469990162b.zip skiboot-99937b9438458967ab205b37854d6c469990162b.tar.gz skiboot-99937b9438458967ab205b37854d6c469990162b.tar.bz2 |
core/pcie-slot: Set power state from the PWRCTL flag
For some reason we look at the power control indicator and use that to
determine if the slot is "off" rather than the power control flag that
is used to power down the slot.
While we're here change the default behaviour so that the slot is
assumed to be powered on if there's no slot capability, or if there's
no power control available.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | core/pcie-slot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/pcie-slot.c b/core/pcie-slot.c index 4599634..e90fc5d 100644 --- a/core/pcie-slot.c +++ b/core/pcie-slot.c @@ -473,14 +473,14 @@ struct pci_slot *pcie_slot_create(struct phb *phb, struct pci_device *pd) if (slot->slot_cap & PCICAP_EXP_SLOTCAP_HPLUG_CAP) slot->pluggable = 1; + /* Assume the slot is powered on by default */ + slot->power_state = PCI_SLOT_POWER_ON; if (slot->slot_cap & PCICAP_EXP_SLOTCAP_PWCTRL) { slot->power_ctl = 1; - /* The power is on by default */ - slot->power_state = PCI_SLOT_POWER_ON; pci_cfg_read16(phb, pd->bdfn, ecap + PCICAP_EXP_SLOTCTL, &slot_ctl); - if (((slot_ctl & PCICAP_EXP_SLOTCTL_PWRI) >> 8) == PCIE_INDIC_OFF) + if (slot_ctl & PCICAP_EXP_SLOTCTL_PWRCTLR) slot->power_state = PCI_SLOT_POWER_OFF; } |