From: Quentin Schulz <quentin.schulz@cherry.de>
To: dmukhin@ford.com, u-boot@lists.denx.de
Cc: sjg@chromium.org, trini@konsulko.com
Subject: Re: [PATCH v4 2/7] reset: Add explicit cold reset support
Date: Fri, 26 Jun 2026 17:00:12 +0200 [thread overview]
Message-ID: <dc8099b0-bd91-4aec-8683-16e46b7910cb@cherry.de> (raw)
In-Reply-To: <20260603070743.1268544-3-dmukhin@ford.com>
Hi Denis,
On 6/3/26 9:07 AM, dmukhin@ford.com wrote:
> Some prototype boards default to a non-cold reset type, e.g. warm reset.
>
> Add 'reset -c' so users can explicitly request a cold reset when needed.
>
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> ---
> Changes since v3:
> - preserved existing behavior for 'reset -edl' handling
> - corrected commit message formatting
> ---
> cmd/boot.c | 3 ++-
> drivers/sysreset/sysreset-uclass.c | 13 +++++++++++--
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/cmd/boot.c b/cmd/boot.c
> index 29cdf4a9a81a..5cac6cf3fed0 100644
> --- a/cmd/boot.c
> +++ b/cmd/boot.c
> @@ -59,13 +59,14 @@ U_BOOT_CMD(
> U_BOOT_CMD(
> reset, 2, 0, do_reset,
> "Perform RESET of the CPU",
> - "- cold boot without level specifier\n"
> + "- reset using the configured default type\n"
NACK. It performs a cold boot when the level (-w) is not specified so we
need to keep this as is.
> #if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_ARGS)
> // All options handled by sysreset drivers via their sysreset_ops.request_arg callback
> #ifdef CONFIG_SYSRESET_QCOM_PSCI
> "reset -edl - Boot to Emergency DownLoad mode\n"
> #endif
> #endif
> + "reset -c - cold reset if implemented\n"
But... why? `reset` already does that why do we need yet another option
for something we already do when no argument is passed?
> "reset -w - warm reset if implemented"
> );
>
> diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
> index 5c6dd7cc1c55..1ba698b37285 100644
> --- a/drivers/sysreset/sysreset-uclass.c
> +++ b/drivers/sysreset/sysreset-uclass.c
> @@ -168,8 +168,17 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
> if (argc > 2)
> return CMD_RET_USAGE;
>
> - if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'w') {
> - reset_type = SYSRESET_WARM;
> + if (argc == 2 && argv[1][0] == '-' && strlen(argv[1]) == 2) {
> + switch (argv[1][1]) {
> + case 'c':
> + reset_type = SYSRESET_COLD;
> + break;
> + case 'w':
> + reset_type = SYSRESET_WARM;
> + break;
> + default:
> + return CMD_RET_USAGE;
NACK. We support passing arguments to sysreset drivers whenever -w is
not passed, so this will break them. See the sysreset_walk_arg below.
Cheers,
Quentin
next prev parent reply other threads:[~2026-06-26 15:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 7:07 [PATCH v4 0/7] reset: add board reset type dmukhin
2026-06-03 7:07 ` [PATCH v4 1/7] reset: Allow per-board " dmukhin
2026-06-03 7:07 ` [PATCH v4 2/7] reset: Add explicit cold reset support dmukhin
2026-06-03 17:04 ` Simon Glass
2026-06-16 21:44 ` Tom Rini
2026-06-17 6:29 ` dmukhin
2026-07-29 8:21 ` Denis Mukhin via U-Boot
2026-06-26 15:00 ` Quentin Schulz [this message]
2026-06-27 8:28 ` Simon Glass
2026-06-03 7:07 ` [PATCH v4 3/7] reset: Print reset type on diagnostic console dmukhin
2026-06-03 17:04 ` Simon Glass
2026-06-26 15:01 ` Quentin Schulz
2026-06-27 8:30 ` Simon Glass
2026-07-23 16:43 ` Quentin Schulz
2026-07-28 11:38 ` Simon Glass
2026-07-28 11:43 ` Quentin Schulz
2026-07-28 11:49 ` Simon Glass
2026-06-03 7:07 ` [PATCH v4 4/7] reset: x86: Use cpu_hlt() in pch_sysreset_power_off() dmukhin
2026-06-03 17:04 ` Simon Glass
2026-06-03 7:07 ` [PATCH v4 5/7] reset: x86: Use cpu_hlt() in efi_reset_system() dmukhin
2026-06-03 17:04 ` Simon Glass
2026-06-03 7:07 ` [PATCH v4 6/7] docs: reset: document cold reset option dmukhin
2026-06-03 17:04 ` Simon Glass
2026-06-26 15:05 ` Quentin Schulz
2026-06-03 7:07 ` [PATCH v4 7/7] tests: reset: add cold/warm reset types dmukhin
2026-06-03 17:05 ` 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=dc8099b0-bd91-4aec-8683-16e46b7910cb@cherry.de \
--to=quentin.schulz@cherry.de \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox