diff mbox series

[1/2] pcie-slot: Don't fail powering on an already on switch

Message ID 20180409034144.22477-1-benh@kernel.crashing.org
State Accepted
Headers show
Series [1/2] pcie-slot: Don't fail powering on an already on switch | expand

Commit Message

Benjamin Herrenschmidt April 9, 2018, 3:41 a.m. UTC
If the power state is already the required value, return
OPAL_SUCCESS rather than OPAL_PARAMETER to avoid spurrious
errors during boot.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 core/pcie-slot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Neuling April 9, 2018, 3:48 a.m. UTC | #1
On Mon, 2018-04-09 at 13:41 +1000, Benjamin Herrenschmidt wrote:
> If the power state is already the required value, return
> OPAL_SUCCESS rather than OPAL_PARAMETER to avoid spurrious
> errors during boot.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-By: Michael Neuling <mikey@neuling.org>

> ---
>  core/pcie-slot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/pcie-slot.c b/core/pcie-slot.c
> index c3069040..45996342 100644
> --- a/core/pcie-slot.c
> +++ b/core/pcie-slot.c
> @@ -205,7 +205,7 @@ static int64_t pcie_slot_set_power_state_ext(struct
> pci_slot *slot, uint8_t val,
>  	uint16_t state;
>  
>  	if (slot->power_state == val)
> -		return OPAL_PARAMETER;
> +		return OPAL_SUCCESS;
>  
>  	/* Update the power state and return immediately if the power
>  	 * control functionality isn't supported on the PCI slot.
Stewart Smith April 10, 2018, 6:33 a.m. UTC | #2
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> If the power state is already the required value, return
> OPAL_SUCCESS rather than OPAL_PARAMETER to avoid spurrious
> errors during boot.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  core/pcie-slot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Merged to master as of bca7c02f519d468c075912eccbf04bbee4523358

Added bonus of we now seem to conform to our own API docs.
diff mbox series

Patch

diff --git a/core/pcie-slot.c b/core/pcie-slot.c
index c3069040..45996342 100644
--- a/core/pcie-slot.c
+++ b/core/pcie-slot.c
@@ -205,7 +205,7 @@  static int64_t pcie_slot_set_power_state_ext(struct pci_slot *slot, uint8_t val,
 	uint16_t state;
 
 	if (slot->power_state == val)
-		return OPAL_PARAMETER;
+		return OPAL_SUCCESS;
 
 	/* Update the power state and return immediately if the power
 	 * control functionality isn't supported on the PCI slot.