mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/7] misc: implement PSCI system reset driver
Date: Wed, 6 Nov 2019 10:32:35 +0100	[thread overview]
Message-ID: <20191106093235.yikgauqikv7nnk2x@pengutronix.de> (raw)
In-Reply-To: <20191106071034.24452-5-a.fatoum@pengutronix.de>

On Wed, Nov 06, 2019 at 08:10:32AM +0100, Ahmad Fatoum wrote:
> In cases where firmware provides PSCI >0.1, it may be prudent to use it as
> backend for reset and poweroff. This driver accomplishes this.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/misc/Kconfig         |  5 +++
>  drivers/misc/Makefile        |  1 +
>  drivers/misc/psci-sysreset.c | 62 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 68 insertions(+)
>  create mode 100644 drivers/misc/psci-sysreset.c
> 
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 0f736f8bded3..0412fcf02aa3 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -35,4 +35,9 @@ config UBOOTVAR
>  	  While it can be used standalone, it is best when coupled
>  	  with corresponding filesystem driver.
>  
> +config PSCI_SYSRESET
> +	bool "PSCI system reset driver"
> +	select ARM_PSCI_CLIENT
> +	depends on CPU_32v7 || CPU_64v8

I would rather prefer to be ARM_PSCI_CLIENT a user visible option.

> +static int __init psci_sysreset_init(void)
> +{
> +	int version;
> +	int ret;
> +
> +	version = psci_get_version();
> +	if (version < 0)
> +		return version;

This prints a warning for everyone who has this code enabled but doesn't
have psci support. Also you enforce that the psci client driver has to
be registered already.
I think this code should rather be merged into the psci client driver,
there's no need for an additional initcall.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-11-06  9:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  7:10 [PATCH 1/7] misc: psci: translate PSCI error codes in smc command Ahmad Fatoum
2019-11-06  7:10 ` [PATCH 2/7] ARM: psci: use CONFIG_ARM_PSCI_DEBUG for " Ahmad Fatoum
2019-11-06  7:10 ` [PATCH 3/7] psci: wire in smc command help Ahmad Fatoum
2019-11-06  7:10 ` [PATCH 4/7] misc: implement PSCI client driver Ahmad Fatoum
2019-11-06  7:10 ` [PATCH 5/7] misc: implement PSCI system reset driver Ahmad Fatoum
2019-11-06  9:32   ` Sascha Hauer [this message]
2019-11-06  7:10 ` [PATCH 6/7] ARM: stm32mp: select ARM_USE_COMPRESSED_DTB for the whole arch Ahmad Fatoum
2019-11-06  7:10 ` [PATCH 7/7] ARM: dts: stm32mp: report psci v0.2 at least Ahmad Fatoum

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=20191106093235.yikgauqikv7nnk2x@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@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