All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmukhin@ford.com
To: Simon Glass <sjg@chromium.org>
Cc: dmukhin@ford.com, u-boot@lists.denx.de, trini@konsulko.com
Subject: Re: [PATCH v3 1/6] reset: Allow per-board reset type
Date: Mon, 1 Jun 2026 23:29:55 -0700	[thread overview]
Message-ID: <ah54Y+7it06w9zku@kraken> (raw)
In-Reply-To: <CAFLszTjYa_=jNmRXO5rbMh4K=uEimwBdq1HS1iNmtAGhznVfqw@mail.gmail.com>

On Mon, Jun 01, 2026 at 08:54:18AM -0600, Simon Glass wrote:
> Hi Denis,
> 
> On 2026-05-29T03:48:33, None <dmukhin@ford.com> wrote:
> > reset: Allow per-board reset type
> >
> > Some prototype boards may not have (temporarily) all required reset
> > types supported (e.g. only warm reset supported).
> >
> > Add a Kconfig choice to select the board-specific default reset type
> > used by the reset command, allowing it to work on such boards.
> >
> > Keep cold reset as the default.
> >
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> >
> > drivers/sysreset/Kconfig           | 31 +++++++++++++++++++++++++++++++
> >  drivers/sysreset/sysreset-uclass.c | 19 ++++++++++++++++++-
> >  2 files changed, 49 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>

Thanks!

> 
> > diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> > @@ -57,6 +57,37 @@ config SYSRESET_CMD_RESET_ARGS
> > +config SYSRESET_CMD_RESET_DEFAULT_WARM
> > +     bool "Warm reset"
> > +     help
> > +       Reset CPU while keeping GPIOs active.
> > +
> > +config SYSRESET_CMD_RESET_DEFAULT_COLD
> > +     bool "Cold reset"
> > +     help
> > +       Reset CPU and GPIOs.
> 
> This is very thin - as is the comment in include/sysreset.h - how about:
> 
> "Full cold reset of the machine, including CPU, GPIOs, PMIC and other
> logic in the machine"
> 
> > diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> > @@ -57,6 +57,37 @@ config SYSRESET_CMD_RESET_ARGS
> > +config SYSRESET_CMD_RESET_DEFAULT_POWER
> > +     bool "Power reset"
> > +     help
> > +       Reset PMIC by removing and restoring power.
> > +
> > +config SYSRESET_CMD_RESET_DEFAULT_POWER_OFF
> > +     bool "Power off"
> > +     help
> > +       Turn off power.
> 
> Could we use the 'poweroff' command instead?

Will drop SYSRESET_CMD_RESET_DEFAULT_POWER_OFF in v4 and leave
a code commentary to rely on poweroff command.

> 
> > diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
> > @@ -150,9 +150,26 @@ void reset_cpu(void)
> > +static enum sysreset_t sysreset_get_default_type(void)
> > +{
> > +     if (IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_DEFAULT_WARM))
> > +             return SYSRESET_WARM;
> > +
> > +     if (IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_DEFAULT_COLD))
> > +             return SYSRESET_COLD;
> > +
> > +     if (IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_DEFAULT_POWER))
> > +             return SYSRESET_POWER;
> > +
> > +     if (IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_DEFAULT_POWER_OFF))
> > +             return SYSRESET_POWER_OFF;
> > +
> > +     return SYSRESET_COLD;
> > +}
> 
> The trailing return SYSRESET_COLD is unreachable, BTW.

Thanks for the catch!

> 
> Regards,
> Simon

  reply	other threads:[~2026-06-02  6:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29  3:48 [PATCH v3 0/6] reset: add board reset type dmukhin
2026-05-29  3:48 ` [PATCH v3 1/6] reset: Allow per-board " dmukhin
2026-06-01 14:54   ` Simon Glass
2026-06-02  6:29     ` dmukhin [this message]
2026-05-29  3:48 ` [PATCH v3 2/6] reset: Add explicit cold reset support dmukhin
2026-06-01 14:54   ` Simon Glass
2026-06-02  6:31     ` dmukhin
2026-05-29  3:48 ` [PATCH v3 3/6] reset: Print reset type on diagnostic console dmukhin
2026-06-01 14:54   ` Simon Glass
2026-05-29  3:48 ` [PATCH v3 4/6] reset: x86: Use cpu_hlt() in pch_sysreset_power_off() dmukhin
2026-06-01 14:54   ` Simon Glass
2026-06-02  6:33     ` dmukhin
2026-05-29  3:48 ` [PATCH v3 5/6] docs: reset: document cold reset option dmukhin
2026-06-01 14:54   ` Simon Glass
2026-05-29  3:48 ` [PATCH v3 6/6] tests: reset: add cold/warm reset types dmukhin
2026-06-01 14:55   ` Simon Glass

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=ah54Y+7it06w9zku@kraken \
    --to=dmukhin@ford.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.