From: Quentin Schulz <quentin.schulz@cherry.de>
To: Simon Glass <sjg@chromium.org>
Cc: dmukhin@ford.com, u-boot@lists.denx.de, trini@konsulko.com
Subject: Re: [PATCH v4 3/7] reset: Print reset type on diagnostic console
Date: Thu, 23 Jul 2026 18:43:32 +0200 [thread overview]
Message-ID: <90e62165-aee3-4e36-bd1e-3d5cbb991f11@cherry.de> (raw)
In-Reply-To: <CAFLszThwW5Ff6JjCd+xX-fKR6phTD3ZoqtfvS6+hXRc-cH1Oeg@mail.gmail.com>
Hi Simon,
On 6/27/26 10:30 AM, Simon Glass wrote:
> Hi Quentin,
>
> On Fri, 26 Jun 2026 at 16:01, Quentin Schulz <quentin.schulz@cherry.de> wrote:
>>
>> Hi Denis,
>>
>> On 6/3/26 9:07 AM, dmukhin@ford.com wrote:
>>> Add a diagnostic console trace indicating the reset type.
>>>
>>> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
>>> ---
>>> Changes since v3:
>>> - moved get_reset_type_str() next to do_reset()
>>> ---
>>> drivers/sysreset/sysreset-uclass.c | 18 +++++++++++++++++-
>>> 1 file changed, 17 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
>>> index 1ba698b37285..2b7717857ce6 100644
>>> --- a/drivers/sysreset/sysreset-uclass.c
>>> +++ b/drivers/sysreset/sysreset-uclass.c
>>> @@ -161,6 +161,22 @@ static enum sysreset_t sysreset_get_default_type(void)
>>> return SYSRESET_COLD;
>>> }
>>>
>>> +static const char *get_reset_type_str(enum sysreset_t reset_type)
>>> +{
>>> + switch (reset_type) {
>>> + case SYSRESET_WARM:
>>> + return "warm";
>>> + case SYSRESET_COLD:
>>> + return "cold";
>>> + case SYSRESET_POWER:
>>> + return "power";
>>> + case SYSRESET_POWER_OFF:
>>> + return "power off";
>>> + default:
>>> + return "unknown";
>>> + }
>>> +}
>>> +
>>> int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
>>> {
>>> enum sysreset_t reset_type = sysreset_get_default_type();
>>> @@ -181,7 +197,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
>>> }
>>> }
>>>
>>> - printf("resetting ...\n");
>>> + printf("resetting (%s)...\n", get_reset_type_str(reset_type));
>>
>> NACK, this is potentially misleading as sysreset drivers can end up
>> performing something different (see sysreset_walk_arg() just below).
>
> That's always been the case, but it was silent - do you suggest that
We only said we are resetting, not which kind.
> it prints a new reset message for each type? Bear in mind that when
> one succeeds it is unlikely that the serial console will be updated
> before the reset happens. In the majority of cases the requested reset
> succeeds.
>
Indeed.
> I quite like showing which reset is being attempted.
I don't think it's worth the potential confusion. After all, we may very
well NOT do the requested kind of reset. Wording will be important if we
really want to do this. We need to be clear something else may be done
in the end.
We could print before attempting each sysreset type which kind we're
trying... I think it's actually a good idea, because it isn't
necessarily clear that even if you request a warm reset, you may still
get a cold reset (or even a power-off) if no driver supports doing a
warm reset. At the same time, we don't have a delay between printing and
attempting a reset, so indeed like you said it may never get printed.
So, first line in the while-loop in sysreset_walk would say "attempting
sysreset <type>" and after the for-loop we check on ret != -EINPROGRESS
and then print "no driver could do sysreset <type>, trying more
aggressive reset" or something like that. Before return, we check on
-EINPROGRESS and tell the user we failed to do any kind of reset. We
probably should have some of those messages rather debug messages
though, I fear it may be a bit verbose.
Cheers,
Quentin
next prev parent reply other threads:[~2026-07-23 16:43 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
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 [this message]
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=90e62165-aee3-4e36-bd1e-3d5cbb991f11@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 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.