openrisc.lists.librecores.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Stafford Horne <shorne@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	 Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Andrew Davis <afd@ti.com>,
	linux-openrisc@vger.kernel.org
Subject: Re: [PATCH] openrisc: Use do_kernel_power_off()
Date: Sun, 14 Apr 2024 19:52:03 +0200	[thread overview]
Message-ID: <rfbxtgppobtvtp2flghzpw7mzlrhnzwuk5gulwdauf5ecfkpa7@xk4qspf3mo3c> (raw)
In-Reply-To: <20240331070230.2252922-1-shorne@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

Hi,

On Sun, Mar 31, 2024 at 08:02:28AM +0100, Stafford Horne wrote:
> After commit 14c5678720bd ("power: reset: syscon-poweroff: Use
> devm_register_sys_off_handler(POWER_OFF)") setting up of pm_power_off
> was removed from the driver, this causes OpenRISC platforms using
> syscon-poweroff to no longer shutdown.
> 
> The kernel now supports chained power-off handlers. Use
> do_kernel_power_off() that invokes chained power-off handlers.  All
> architectures have moved away from using pm_power_off except OpenRISC.
> 
> This patch migrates openrisc to use do_kernel_power_off() instead of the
> legacy pm_power_off().
> 
> Fixes: 14c5678720bd ("power: reset: syscon-poweroff: Use devm_register_sys_off_handler(POWER_OFF)")
> Signed-off-by: Stafford Horne <shorne@gmail.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

>  arch/openrisc/kernel/process.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
> index 86e02929f3ac..3c27d1c72718 100644
> --- a/arch/openrisc/kernel/process.c
> +++ b/arch/openrisc/kernel/process.c
> @@ -65,7 +65,7 @@ void machine_restart(char *cmd)
>  }
>  
>  /*
> - * This is used if pm_power_off has not been set by a power management
> + * This is used if a sys-off handler was not set by a power management
>   * driver, in this case we can assume we are on a simulator.  On
>   * OpenRISC simulators l.nop 1 will trigger the simulator exit.
>   */
> @@ -89,10 +89,8 @@ void machine_halt(void)
>  void machine_power_off(void)
>  {
>  	printk(KERN_INFO "*** MACHINE POWER OFF ***\n");
> -	if (pm_power_off != NULL)
> -		pm_power_off();
> -	else
> -		default_power_off();
> +	do_kernel_power_off();
> +	default_power_off();
>  }
>  
>  /*
> -- 
> 2.44.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-04-14 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-31  7:02 [PATCH] openrisc: Use do_kernel_power_off() Stafford Horne
2024-04-14 17:52 ` Sebastian Reichel [this message]
2024-04-15 14:22   ` Stafford Horne

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=rfbxtgppobtvtp2flghzpw7mzlrhnzwuk5gulwdauf5ecfkpa7@xk4qspf3mo3c \
    --to=sebastian.reichel@collabora.com \
    --cc=afd@ti.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=shorne@gmail.com \
    --cc=stefan.kristiansson@saunalahti.fi \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).