Skip to content

Commit 9a48888

Browse files
zhang-ruirafaeljw
authored andcommitted
ACPI: reboot: Avoid racing after writing to ACPI RESET_REG
According to the ACPI spec, "The system must reset immediately following the write to the ACPI RESET_REG register.", but there are cases that the system does not follow this and results in racing with the subsequetial reboot mechanism, which brings unexpected behavior. Fix this by adding a 15ms delay after writing to the ACPI RESET_REG. Reported-by: Ghorai, Sukumar <sukumar.ghorai@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> [ rjw: Edit comment in the code and subject ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent cf1d2b4 commit 9a48888

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/acpi/reboot.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/pci.h>
44
#include <linux/acpi.h>
55
#include <acpi/reboot.h>
6+
#include <linux/delay.h>
67

78
#ifdef CONFIG_PCI
89
static void acpi_pci_reboot(struct acpi_generic_address *rr, u8 reset_value)
@@ -66,4 +67,14 @@ void acpi_reboot(void)
6667
acpi_reset();
6768
break;
6869
}
70+
71+
/*
72+
* Some platforms do not shut down immediately after writing to the
73+
* ACPI reset register, and this results in racing with the
74+
* subsequent reboot mechanism.
75+
*
76+
* The 15ms delay has been found to be long enough for the system
77+
* to reboot on the affected platforms.
78+
*/
79+
mdelay(15);
6980
}

0 commit comments

Comments
 (0)