diff mbox series

core/platform: Fallback to full_reboot if fast-reboot fails

Message ID 20201124071621.199352-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series core/platform: Fallback to full_reboot if fast-reboot fails | expand

Checks

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

Commit Message

Vasant Hegde Nov. 24, 2020, 7:16 a.m. UTC
If fast reboot fails then we return to Linux with OPAL_SUCCESS.
Current Linux code thinks that request succedded and enters
infinite loop (see Linux pnv_restart() code).

This patch fixes above issue by return OPAL_UNSUPPORTED if fast
reboot fails.

Alternatively we can directly all full_reboot() itself. But I
think it makes sense to go back to Linux and report the failure.
And Linux falls back to normal reboot request.

Fixes: 10bbcd07 ("core/platform: Add an explicit fast-reboot type")
Cc: Oliver O'Halloran <oohall@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 core/platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Ellerman Nov. 24, 2020, 7:44 a.m. UTC | #1
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> If fast reboot fails then we return to Linux with OPAL_SUCCESS.
> Current Linux code thinks that request succedded and enters
> infinite loop (see Linux pnv_restart() code).
>
> This patch fixes above issue by return OPAL_UNSUPPORTED if fast
> reboot fails.
>
> Alternatively we can directly all full_reboot() itself. But I
                                ^
                                call
> think it makes sense to go back to Linux and report the failure.
> And Linux falls back to normal reboot request.
>
> Fixes: 10bbcd07 ("core/platform: Add an explicit fast-reboot type")
> Cc: Oliver O'Halloran <oohall@gmail.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
>  core/platform.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

> diff --git a/core/platform.c b/core/platform.c
> index 8f4a3b877..320fdea03 100644
> --- a/core/platform.c
> +++ b/core/platform.c
> @@ -124,7 +124,8 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
>  	case OPAL_REBOOT_FAST:
>  		prlog(PR_NOTICE, "Reboot: Fast reboot requested by OS\n");
>  		fast_reboot();
> -		break;
> +		prlog(PR_NOTICE, "Reboot: Fast reboot failed\n");
> +		return OPAL_UNSUPPORTED;
>  	default:
>  		prlog(PR_NOTICE, "OPAL: Unsupported reboot request %d\n", reboot_type);
>  		return OPAL_UNSUPPORTED;
> -- 
> 2.26.2
Dan Horák Nov. 24, 2020, 10:38 a.m. UTC | #2
On Tue, 24 Nov 2020 12:46:21 +0530
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:

> If fast reboot fails then we return to Linux with OPAL_SUCCESS.
> Current Linux code thinks that request succedded and enters
> infinite loop (see Linux pnv_restart() code).
> 
> This patch fixes above issue by return OPAL_UNSUPPORTED if fast
> reboot fails.
> 
> Alternatively we can directly all full_reboot() itself. But I
> think it makes sense to go back to Linux and report the failure.
> And Linux falls back to normal reboot request.
> 
> Fixes: 10bbcd07 ("core/platform: Add an explicit fast-reboot type")
> Cc: Oliver O'Halloran <oohall@gmail.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
>  core/platform.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

LGTM

Reviewed-by: Dan Horák <dan@danny.cz>


		Dan
 
> diff --git a/core/platform.c b/core/platform.c
> index 8f4a3b877..320fdea03 100644
> --- a/core/platform.c
> +++ b/core/platform.c
> @@ -124,7 +124,8 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
>  	case OPAL_REBOOT_FAST:
>  		prlog(PR_NOTICE, "Reboot: Fast reboot requested by OS\n");
>  		fast_reboot();
> -		break;
> +		prlog(PR_NOTICE, "Reboot: Fast reboot failed\n");
> +		return OPAL_UNSUPPORTED;
>  	default:
>  		prlog(PR_NOTICE, "OPAL: Unsupported reboot request %d\n", reboot_type);
>  		return OPAL_UNSUPPORTED;
> -- 
> 2.26.2
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
Vasant Hegde Nov. 27, 2020, 11:58 a.m. UTC | #3
On 11/24/20 12:46 PM, Vasant Hegde wrote:
> If fast reboot fails then we return to Linux with OPAL_SUCCESS.
> Current Linux code thinks that request succedded and enters
> infinite loop (see Linux pnv_restart() code).
> 
> This patch fixes above issue by return OPAL_UNSUPPORTED if fast
> reboot fails.
> 
> Alternatively we can directly all full_reboot() itself. But I
> think it makes sense to go back to Linux and report the failure.
> And Linux falls back to normal reboot request.
> 

Merged as 8256da31.

-Vasant
diff mbox series

Patch

diff --git a/core/platform.c b/core/platform.c
index 8f4a3b877..320fdea03 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -124,7 +124,8 @@  static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
 	case OPAL_REBOOT_FAST:
 		prlog(PR_NOTICE, "Reboot: Fast reboot requested by OS\n");
 		fast_reboot();
-		break;
+		prlog(PR_NOTICE, "Reboot: Fast reboot failed\n");
+		return OPAL_UNSUPPORTED;
 	default:
 		prlog(PR_NOTICE, "OPAL: Unsupported reboot request %d\n", reboot_type);
 		return OPAL_UNSUPPORTED;