Skip to content

Commit 8dbddf1

Browse files
ebiedermLinus Torvalds
authored andcommitted
[PATCH] acpi_shutdown: Only prepare for power off on power_off
When acpi_sleep_prepare was moved into a shutdown method we started calling it for all shutdowns. It appears this triggers some systems to power off on reboot. Avoid this by only calling acpi_sleep_prepare if we are going to power off the system. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 6a029a9 commit 8dbddf1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/acpi/sleep/poweroff.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ void acpi_power_off(void)
5555

5656
static int acpi_shutdown(struct sys_device *x)
5757
{
58-
return acpi_sleep_prepare(ACPI_STATE_S5);
58+
if (system_state == SYSTEM_POWER_OFF) {
59+
/* Prepare if we are going to power off the system */
60+
return acpi_sleep_prepare(ACPI_STATE_S5);
61+
}
62+
return 0;
5963
}
6064

6165
static struct sysdev_class acpi_sysclass = {

0 commit comments

Comments
 (0)