Skip to content

Commit 5c0e00a

Browse files
bp3tk0vrafaeljw
authored andcommitted
APEI: GHES: Have GHES honor the panic= setting
The GHES driver overrides the panic= setting by force-rebooting the system after a fatal hw error has been reported. The intent being that such an error would be reported earlier. However, this is not optimal when a hard-to-debug issue requires long time to reproduce and when that happens, the box will get rebooted after 30 seconds and thus destroy the whole hw context of when the error happened. So rip out the default GHES panic timeout and honor the global one. In the panic disabled (panic=0) case, the error will still be logged to dmesg for later inspection and if panic after a hw error is really required, then that can be controlled the usual way - use panic= on the cmdline or set it in the kernel .config's CONFIG_PANIC_TIMEOUT. Reported-by: Feng Tang <feng.tang@linux.alibaba.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Feng Tang <feng.tang@linux.alibaba.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Link: https://patch.msgid.link/20250113125224.GFZ4UMiNtWIJvgpveU@fat_crate.local Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5bc55a3 commit 5c0e00a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/acpi/apei/ghes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ static struct gen_pool *ghes_estatus_pool;
173173
static struct ghes_estatus_cache __rcu *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE];
174174
static atomic_t ghes_estatus_cache_alloced;
175175

176-
static int ghes_panic_timeout __read_mostly = 30;
177-
178176
static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx)
179177
{
180178
phys_addr_t paddr;
@@ -983,14 +981,16 @@ static void __ghes_panic(struct ghes *ghes,
983981
struct acpi_hest_generic_status *estatus,
984982
u64 buf_paddr, enum fixed_addresses fixmap_idx)
985983
{
984+
const char *msg = GHES_PFX "Fatal hardware error";
985+
986986
__ghes_print_estatus(KERN_EMERG, ghes->generic, estatus);
987987

988988
ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
989989

990-
/* reboot to log the error! */
991990
if (!panic_timeout)
992-
panic_timeout = ghes_panic_timeout;
993-
panic("Fatal hardware error!");
991+
pr_emerg("%s but panic disabled\n", msg);
992+
993+
panic(msg);
994994
}
995995

996996
static int ghes_proc(struct ghes *ghes)

0 commit comments

Comments
 (0)