lkml.org 
[lkml]   [2012]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] ACPI: Pass u8 flag to acpi_enter_sleep_state from lowlevel assembler.
Date
 With commit a2ef5c4fd44ce3922435139393b89f2cce47f576
"ACPI: Move module parameter gts and bfs to sleep.c" the wake_sleep_flags
is required when calling acpi_enter_sleep_state. But the change
to do that in the x86_acpi_suspend_lowlevel' do_suspend_lowlevel()
was not done. So the call in do_suspend_lowlevel() assembler to
acpi_enter_sleep_state would provide a potentially corrupted wakeup_flag.

This fixes it by passing the paramter.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/kernel/acpi/wakeup_32.S | 5 ++++-
arch/x86/kernel/acpi/wakeup_64.S | 3 +++
2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index 13ab720..9e9260c 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -74,9 +74,12 @@ restore_registers:
ENTRY(do_suspend_lowlevel)
call save_processor_state
call save_registers
+ movzbl wake_sleep_flags, %eax
+ movzbl %al, %eax
+ pushl %eax
pushl $3
call acpi_enter_sleep_state
- addl $4, %esp
+ addl $4*2, %esp

# In case of S3 failure, we'll emerge here. Jump
# to ret_point to recover
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index 8ea5164..66cc2ab 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -72,6 +72,9 @@ ENTRY(do_suspend_lowlevel)

addq $8, %rsp
movl $3, %edi
+ movzbl wake_sleep_flags, %eax
+ movzbl %al, %eax
+ mov %eax,%esi
xorl %eax, %eax
call acpi_enter_sleep_state
/* in case something went wrong, restore the machine status and go on */
--
1.7.7.5


\
 
 \ /
  Last update: 2012-04-10 04:41    [W:0.048 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site