All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Len Brown <lenb@kernel.org>
Cc: Jiri Slaby <jirislaby@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Cyrill Gorcunov <gorcunov@openvz.org>,
	Ingo Molnar <mingo@elte.hu>,
	pm list <linux-pm@lists.linux-foundation.org>
Subject: [PATCH 2/2] x86_64: Fix S3 fail path
Date: Sun, 15 Feb 2009 22:46:45 +0100	[thread overview]
Message-ID: <200902152246.46583.rjw__7667.28258827261$1234734770$gmane$org@sisk.pl> (raw)
In-Reply-To: <200902152244.47326.rjw@sisk.pl>

From: Jiri Slaby <jirislaby@gmail.com>

As acpi_enter_sleep_state can fail, take this into account in
do_suspend_lowlevel and don't return to the do_suspend_lowlevel's
caller. This would break (currently) fpu status and preempt count.

Technically, this means use `call' instead of `jmp' and `jmp' to
the `resume_point' after the `call' (i.e. if
acpi_enter_sleep_state returns=fails). `resume_point' will handle
the restore of fpu and preempt count gracefully.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 arch/x86/kernel/acpi/wakeup_64.S |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/arch/x86/kernel/acpi/wakeup_64.S
===================================================================
--- linux-2.6.orig/arch/x86/kernel/acpi/wakeup_64.S
+++ linux-2.6/arch/x86/kernel/acpi/wakeup_64.S
@@ -73,7 +73,9 @@ ENTRY(do_suspend_lowlevel)
 	addq	$8, %rsp
 	movl	$3, %edi
 	xorl	%eax, %eax
-	jmp	acpi_enter_sleep_state
+	call	acpi_enter_sleep_state
+	/* in case something went wrong, restore the machine status and go on */
+	jmp	resume_point
 
 	.align 4
 resume_point:

  parent reply	other threads:[~2009-02-15 21:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-15 21:44 [PATCH 0/2] PM: x86-64 suspend-resume fix Rafael J. Wysocki
2009-02-15 21:45 ` [PATCH 1/2] x86_64: acpi/wakeup_64 cleanup Rafael J. Wysocki
2009-02-15 21:45 ` Rafael J. Wysocki
2009-02-15 21:46 ` Rafael J. Wysocki [this message]
2009-02-15 21:46 ` [PATCH 2/2] x86_64: Fix S3 fail path Rafael J. Wysocki
2009-02-21  4:46 ` [PATCH 0/2] PM: x86-64 suspend-resume fix Len Brown
2009-02-21  4:46 ` Len Brown

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='200902152246.46583.rjw__7667.28258827261$1234734770$gmane$org@sisk.pl' \
    --to=rjw@sisk.pl \
    --cc=gorcunov@openvz.org \
    --cc=jirislaby@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.