Re: [PATCH REPOST] kexec: return error of machine_kexec() fails

From: Zhang Yanfei
Date: Tue Jul 09 2013 - 21:15:03 EST


ä 2013/7/10 0:16, Stephen Warren åé:
> From: Stephen Warren <swarren@xxxxxxxxxx>
>
> Prior to commit 3ab8352 "kexec jump", if machine_kexec() returned,
> sys_reboot() would return -EINVAL. This patch restores this behaviour
> for the non-KEXEC_JUMP case, where machine_kexec() is not expected to
> return.
>
> This situation can occur on ARM, where kexec requires disabling all but
> one CPU using CPU hotplug. However, if hotplug isn't supported by the
> particular HW the kernel is running on, then kexec cannot succeed.

I don't have an ARM machine, but I believe you are right by reading the
code. So

Acked-by: Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx>

>
> Signed-off-by: Stephen Warren <swarren@xxxxxxxxxx>
> Acked-by: Will Deacon <will.deacon@xxxxxxx>
> ---
> kernel/kexec.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index 59f7b55..bde1190 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -1702,6 +1702,8 @@ int kernel_kexec(void)
> pm_restore_console();
> unlock_system_sleep();
> }
> +#else
> + error = -EINVAL;
> #endif
>
> Unlock:
>


--
Thanks.
Zhang Yanfei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/