Re: [PATCH v5 5/5] x86/CPU/AMD: Print the reason for the last reset

From: Borislav Petkov
Date: Wed Apr 30 2025 - 15:04:19 EST


On Tue, Apr 22, 2025 at 06:48:30PM -0500, Mario Limonciello wrote:
> + /* Iterate on each bit in the 'value' mask: */
> + while (true) {
> + bit = find_next_bit(&value, BITS_PER_LONG, bit + 1);
> +
> + /* Reached the end of the word, no more bits: */
> + if (bit >= BITS_PER_LONG) {
> + if (!nr_reasons)
> + pr_info("x86/amd: Previous system reset reason [0x%08lx]: Unknown\n", value);
> + break;
> + }
> +
> + if (!s5_reset_reason_txt[bit])
> + continue;
> +
> + nr_reasons++;
> + pr_info("x86/amd: Previous system reset reason [0x%08lx]: %s\n",
> + value, s5_reset_reason_txt[bit]);
> + }

What happened to that simpler idea:

https://lore.kernel.org/r/20250411125050.GEZ_kQKtYBfEMDQuXU@fat_crate.local

?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette