Message ID | 1476419167-16688-2-git-send-email-gwshan@linux.vnet.ibm.com |
---|---|
State | Accepted |
Headers | show |
diff --git a/core/pcie-slot.c b/core/pcie-slot.c index 6854ef1..7fe3785 100644 --- a/core/pcie-slot.c +++ b/core/pcie-slot.c @@ -199,13 +199,13 @@ static int64_t pcie_slot_set_power_state(struct pci_slot *slot, uint8_t val) uint32_t ecap; uint16_t state; + if (slot->power_state == val) + return OPAL_PARAMETER; + /* Drop the request if functionality doesn't exist */ if (!(slot->slot_cap & PCICAP_EXP_SLOTCAP_PWCTRL)) return OPAL_SUCCESS; - if (slot->power_state == val) - return OPAL_SUCCESS; - pci_slot_set_state(slot, PCI_SLOT_STATE_SPOWER_START); slot->power_state = val; ecap = pci_cap(pd, PCI_CFG_CAP_ID_EXP, false);