Skip to content

Commit f862f29

Browse files
committed
Merge back ACPI OS services layer (OSL) material for 7.1
2 parents 393815f + 591230c commit f862f29

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ Kernel parameters
190190
unusable. The "log_buf_len" parameter may be useful
191191
if you need to capture more output.
192192

193+
acpi.poweroff_on_fatal= [ACPI]
194+
{0 | 1}
195+
Causes the system to poweroff when the ACPI bytecode signals
196+
a fatal error. The default value of this setting is 1.
197+
Overriding this value should only be done for diagnosing
198+
ACPI firmware problems, as the system might behave erratically
199+
after having encountered a fatal ACPI error.
200+
193201
acpi_enforce_resources= [ACPI]
194202
{ strict | lax | no }
195203
Check for resource conflicts between native drivers

drivers/acpi/osl.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#include <linux/module.h>
1515
#include <linux/kernel.h>
16+
#include <linux/panic.h>
17+
#include <linux/reboot.h>
1618
#include <linux/slab.h>
1719
#include <linux/mm.h>
1820
#include <linux/highmem.h>
@@ -70,6 +72,10 @@ static bool acpi_os_initialized;
7072
unsigned int acpi_sci_irq = INVALID_ACPI_IRQ;
7173
bool acpi_permanent_mmap = false;
7274

75+
static bool poweroff_on_fatal = true;
76+
module_param(poweroff_on_fatal, bool, 0);
77+
MODULE_PARM_DESC(poweroff_on_fatal, "Poweroff when encountering a fatal ACPI error");
78+
7379
/*
7480
* This list of permanent mappings is for memory that may be accessed from
7581
* interrupt context, where we can't do the ioremap().
@@ -1381,9 +1387,20 @@ acpi_status acpi_os_notify_command_complete(void)
13811387

13821388
acpi_status acpi_os_signal(u32 function, void *info)
13831389
{
1390+
struct acpi_signal_fatal_info *fatal_info;
1391+
13841392
switch (function) {
13851393
case ACPI_SIGNAL_FATAL:
1386-
pr_err("Fatal opcode executed\n");
1394+
fatal_info = info;
1395+
pr_emerg("Fatal error while evaluating ACPI control method\n");
1396+
pr_emerg("Type 0x%X Code 0x%X Argument 0x%X\n",
1397+
fatal_info->type, fatal_info->code, fatal_info->argument);
1398+
1399+
if (poweroff_on_fatal)
1400+
orderly_poweroff(true);
1401+
else
1402+
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
1403+
13871404
break;
13881405
case ACPI_SIGNAL_BREAKPOINT:
13891406
/*

0 commit comments

Comments
 (0)