diff mbox series

[8/8] core/pcie-slot: Don't bail early in the power on case

Message ID 20190318061058.3753-8-oohall@gmail.com
State Accepted
Headers show
Series [1/8] hdata/iohub: Look for IOVPD on P9 | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (2ba5ce84a197ee61423355f443a3ff3eea185ff1)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Oliver O'Halloran March 18, 2019, 6:10 a.m. UTC
Exiting early in the power off case makes sense since we can't disable
slot power (or assert PERST) for suprise hotplug slots. However, we
should not exit early in the power-on case since it's possible slot
power may have been disabled (or just not enabled at boot time).

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/pcie-slot.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/core/pcie-slot.c b/core/pcie-slot.c
index 8696129f3a23..e7013d1ebfa2 100644
--- a/core/pcie-slot.c
+++ b/core/pcie-slot.c
@@ -234,10 +234,11 @@  static int64_t pcie_slot_set_power_state_ext(struct pci_slot *slot, uint8_t val,
 		if (val == PCI_SLOT_POWER_OFF)
 			return OPAL_SUCCESS;
 
-		if (!pci_slot_has_flags(slot, PCI_SLOT_FLAG_FORCE_POWERON)) {
-			pci_slot_set_state(slot, PCI_SLOT_STATE_SPOWER_DONE);
-			return OPAL_ASYNC_COMPLETION;
-		}
+		/*
+		 * Some systems have the slot power disabled by default
+		 * so we always perform the power-on step. This is not
+		 * *strictly* required, but it's probably a good idea.
+		 */
 	}
 
 	pci_slot_set_state(slot, PCI_SLOT_STATE_SPOWER_START);