mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: ming.m.lin@intel.com, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, lenb@kernel.org,
	linux-acpi@vger.kernel.org, konrad.r.wilk@gmail.com
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 2/2] ACPI: Pass u8 flag to acpi_enter_sleep_state from lowlevel assembler.
Date: Mon,  9 Apr 2012 22:34:06 -0400	[thread overview]
Message-ID: <1334025246-8811-3-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1334025246-8811-1-git-send-email-konrad.wilk@oracle.com>

 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


      parent reply	other threads:[~2012-04-10  2:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10  2:34 [PATCH] gts and bfs fixes (v2) Konrad Rzeszutek Wilk
2012-04-10  2:34 ` [PATCH 1/2] ACPI: Convert wake_sleep_flags to a value instead of function (v2) Konrad Rzeszutek Wilk
2012-04-10  2:50   ` Lin Ming
2012-04-10  3:19     ` Konrad Rzeszutek Wilk
2012-04-10  3:22     ` Konrad Rzeszutek Wilk
2012-04-10  2:34 ` Konrad Rzeszutek Wilk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334025246-8811-3-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=konrad.r.wilk@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®