linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] efi/arm64: use UEFI for system reset
Date: Fri, 29 Aug 2014 17:04:48 +0100	[thread overview]
Message-ID: <20140829160448.GF4995@arm.com> (raw)
In-Reply-To: <1409324757-12607-2-git-send-email-ard.biesheuvel@linaro.org>

On Fri, Aug 29, 2014 at 04:05:57PM +0100, Ard Biesheuvel wrote:
> If UEFI Runtime Services are available, they are preferred over direct
> PSCI calls or other methods to reset the system.
> 
> For the reset case, we need to hook into machine_restart(), as the
> arm_pm_restart function pointer may be overwritten by modules.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/kernel/process.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> index 1309d64aa926..335a93da5eeb 100644
> --- a/arch/arm64/kernel/process.c
> +++ b/arch/arm64/kernel/process.c
> @@ -177,6 +177,13 @@ void machine_restart(char *cmd)
>  	local_irq_disable();
>  	smp_send_stop();
>  
> +	/*
> +	 * arm_pm_restart is exported to modules, so the only way to supersede
> +	 * it with efi_reboot() is to call it here.
> +	 */

Why do you make this the preferred method? Is there a risk that UEFI is
broken and we want to override it with a SoC-specific driver (I wouldn't
like it but it's still an option).

There are also some patches here that try to get rid of arm_pm_restart:

https://lkml.org/lkml/2014/8/19/665

Once there are no drivers for arm64 setting arm_pm_restart explicitly
I'll remove it.

> +	if (IS_ENABLED(CONFIG_EFI) && efi_enabled(EFI_RUNTIME_SERVICES))

efi_enabled always returns false if !IS_ENABLED(CONFIG_EFI).

> +		efi_reboot(REBOOT_WARM, NULL);
> +
>  	/* Now call the architecture specific reboot code. */
>  	if (arm_pm_restart)
>  		arm_pm_restart(reboot_mode, cmd);
> -- 
> 1.8.3.2
> 
> 

-- 
Catalin

  parent reply	other threads:[~2014-08-29 16:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 15:05 [PATCH 1/2] efi/arm64: use UEFI for system poweroff Ard Biesheuvel
2014-08-29 15:05 ` [PATCH 2/2] efi/arm64: use UEFI for system reset Ard Biesheuvel
2014-08-29 15:57   ` Mark Salter
2014-08-29 16:04   ` Catalin Marinas [this message]
2014-08-29 16:12     ` Ard Biesheuvel
2014-08-29 16:25       ` Catalin Marinas
2014-08-29 16:43         ` Ard Biesheuvel
2014-08-30  2:17         ` Leif Lindholm
2014-08-29 17:57       ` Mark Rutland
2014-08-29 16:06   ` Mark Rutland
2014-08-29 16:01 ` [PATCH 1/2] efi/arm64: use UEFI for system poweroff Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140829160448.GF4995@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).