Re: [PATCH v2 2/2] x86/CPU/AMD: Print the reason for the last reset

From: Mario Limonciello
Date: Tue Apr 08 2025 - 14:19:53 EST


On 4/8/2025 1:14 PM, Borislav Petkov wrote:
On Tue, Apr 08, 2025 at 12:47:26PM -0500, Mario Limonciello wrote:
diff --git a/Documentation/admin-guide/amd/amd-reboot-reason.csv b/Documentation/admin-guide/amd/amd-reboot-reason.csv
new file mode 100644
index 0000000000000..c31c7a0464c38
--- /dev/null
+++ 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
\ No newline at end of file

Do we need that table now?

I think it's still valuable to have it in documentation for anyone who wants to read more about this. As we get issues that come out of the woodwork I could see people punching the string into a search engine and then being spit at debugging.rst and we can adjust documentation to tell them what to do with it when it's not clear.


If so, why not integrate it into debugging.rst?


That's what this does:

+.. csv-table::
+ :header-rows: 1
+ :widths: 1, 1, 1
+ :file: ./amd-reboot-reason.csv

Or do you mean directly in the RST itself? The RST documentation [1] said and I quote: "Choose whatever sucks least."

Link: https://pandemic-overview.readthedocs.io/en/latest/myGuides/reStructuredText-Tables-Examples.html [1]