linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, "H . Peter Anvin" <hpa@zytor.com>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [PATCH 2/2] x86/CPU/AMD: Print the reason for the last reset
Date: Mon, 7 Apr 2025 13:56:57 -0500	[thread overview]
Message-ID: <ebfaae8d-7186-454f-ba06-b86fea357d03@kernel.org> (raw)
In-Reply-To: <Z_Qdn_WYAalNAHOi@gmail.com>

On 4/7/2025 1:46 PM, Ingo Molnar wrote:
> 
> * Mario Limonciello <superm1@kernel.org> wrote:
> 
>> +++ b/Documentation/admin-guide/amd/amd-reboot-reason.csv
>> @@ -0,0 +1,21 @@
>> +Bit, Type, Reason
>> +0, Pin, Thermal trip (BP_THERMTRIP_L)
>> +1, Pin, Power button
>> +2, Pin, SHUTDOWN# pin
>> +4, Remote, Remote ASF power off command
>> +9, Internal, Thermal trip (internal)
>> +16, Pin, User reset (BP_SYS_RST_L)
>> +17, Software, PCI reset (PMIO 0xC4)
>> +18, Software, CF9 reset (0x04)
>> +19, Software, CF9 reset (0x06)
>> +20, Software, CF9 reset (0x0E)
>> +21, Sleep, Power state or ACPI state transition
>> +22, Pin, Keyboard reset (KB_RST_L)
>> +23, Internal, Internal CPU shutdown
>> +24, Hardware, Failed boot timer
>> +25, Hardware, Watchdog timer
>> +26, Remote, Remote ASF reset command
>> +27, Internal, Data fabric sync flood event due to uncorrected error
>> +29, Internal, MP1 Watchdog timer timeout
>> +30, Internal, Parity error
>> +31, Internal, SW sync flood event
> 
> So I'd much prefer if each bit was iterated, and the above reasons were
> printed out clearly, instead of some arbitrary meta grouping that
> removes useful diagnostic information:
> 
>> +#define PIN_RESET	(BIT(0) | BIT(1) | BIT(2) | BIT(16) | BIT(22))
>> +#define REMOTE_RESET	(BIT(4) | BIT(26))
>> +#define INTERNAL_RESET	(BIT(9) | BIT(23) | BIT(27) | BIT(29) | BIT(30) | BIT(31))
>> +#define SW_RESET	(BIT(17) | BIT(18) | BIT(19) | BIT(20))
>> +#define HW_RESET	(BIT(24) | BIT(25))
>> +#define SLEEP_RESET	(BIT(21))
> 
>> +	pr_info("System reset was due to %s (0x%08x)\n",
>> +		get_s5_reset_reason(value), value);
> 
> I realize that the entire numeric value gets printed as well, but it's
> the symbolic decoding that is most useful to humans.

The way that I "envisioned" this working was someone uses their machine 
and suddenly hits a problem.  When they do they look at 
amd/debugging.rst and then run:

"journalctl -k | grep "System reset was due"

and then map the odd duck(s) out to the table.

> 
> Also, by printing unknown but set bits as 'unknown' we'd have a way to
> clearly signal to users that there's some new diagnostic flag the
> kernel doesn't understand yet.

Right.

> 
> Just a couple of examples:
> 
>   - Printing "Internal, Data fabric sync flood event due to uncorrected error"
>     or "Internal, Parity error" would indicate potential RAM module troubles,
>     while "Internal, Thermal trip (internal)" would indicate cooling system
>     troubles. But with your patch both get printed as some sort of 'internal CPU'
>     problem that is unnecessarily unhelpful...
> 
>   - I don't think representing bit 24 ('Hardware, Failed boot timer') as
>     'Hardware induced' reboot is really helpful either, to me it appears to be
>     a failed bootup time treshold that is more of a firmware thing that may or
>     may not indicate hardware troubles.
> 
>   - etc. etc.
> 
> Basically, the finegrained list of reasons looks perfectly usable to
> me, let's not dumb it down for users unnecessarily, okay?

Boris, your thoughts please?



  reply	other threads:[~2025-04-07 18:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 16:25 [PATCH 1/2] Documentation: Add AMD Zen debugging document Mario Limonciello
2025-04-07 16:25 ` [PATCH 2/2] x86/CPU/AMD: Print the reason for the last reset Mario Limonciello
2025-04-07 18:46   ` Ingo Molnar
2025-04-07 18:56     ` Mario Limonciello [this message]
2025-04-07 19:04       ` Ingo Molnar
2025-04-07 21:46       ` Borislav Petkov
2025-04-08  7:09         ` Ingo Molnar
2025-04-08  7:17           ` Ingo Molnar
2025-04-08 15:45         ` Dave Hansen

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=ebfaae8d-7186-454f-ba06-b86fea357d03@kernel.org \
    --to=superm1@kernel.org \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /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 NNTP newsgroup(s).