mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ondrej Zary <linux@rainbow-software.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] Enable A20 using KBC for some MSI laptops to fix S3 resume
Date: Mon, 10 Dec 2012 13:26:18 -0800	[thread overview]
Message-ID: <50C6537A.9090303@zytor.com> (raw)
In-Reply-To: <201211052135.20009.linux@rainbow-software.org>

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

On 11/05/2012 12:35 PM, Ondrej Zary wrote:
> On Friday 26 October 2012 10:56:44 Ondrej Zary wrote:
>> Some MSI laptop BIOSes are broken - INT 15h code uses port 92h to enable
>> A20 line but resume code assumes that KBC was used.
>> The laptop will not resume from S3 otherwise but powers off after a while
>> and then powers on again stuck with a blank screen.
>>
>> Fix it by enabling A20 using KBC. Affected laptop list and DMI data are
>> from bug reports at Ubuntu Launchpad.
>>
>> Also add kernel parameter to easily activate this quirk on any system.
>>
>> Only compile tested. The original patch was tested with EX600 and PR200.
>>
>> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878
> 
> The bug was marked as RESOLVED CODE_FIX but I wonder what happened to this 
> patch. Was it applied? Or is someone working on a better way to fix this 
> problem?
> 

Sorry, I managed to forget about this.

Is there any way you could test this patch by any chance?

I would be a lot happier if this works as a general solution rather than
relying on a quirk...

	-hpa


[-- Attachment #2: 0001-x86-suspend-Run-A20-test-on-resume.patch --]
[-- Type: text/x-patch, Size: 2155 bytes --]

>From 5513340abd845eaa28fe2394f7e0296599f2d9e7 Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <hpa@linux.intel.com>
Date: Mon, 10 Dec 2012 13:17:48 -0800
Subject: [PATCH] x86, suspend: Run A20 test on resume

If A20 is disabled on resume, we may have to explicitly enable it.
Rather than creating a bunch of ad hoc code, use the same code we
would on system startup.

Note: the startup code implicitly assumes BIOS, specifically that int
$0x15 is enabled.  However, for non-BIOS platforms to have A20 closed
on resume seems extremely unlikely, since pretty much all non-BIOS
firmware run in 32- or 64-bit mode.

Reported-by: Ondrej Zary <linux@rainbow-software.org>
Link: http://lkml.kernel.org/r/201210240847.52417.linux@rainbow-software.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/realmode/rm/Makefile   | 2 +-
 arch/x86/realmode/rm/a20.c      | 1 +
 arch/x86/realmode/rm/wakemain.c | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/realmode/rm/a20.c

diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
index 8869287..7e2ff68 100644
--- a/arch/x86/realmode/rm/Makefile
+++ b/arch/x86/realmode/rm/Makefile
@@ -10,7 +10,7 @@
 always := realmode.bin realmode.relocs
 
 wakeup-objs	:= wakeup_asm.o wakemain.o video-mode.o
-wakeup-objs	+= copy.o bioscall.o regs.o
+wakeup-objs	+= copy.o bioscall.o regs.o a20.o
 # The link order of the video-*.o modules can matter.  In particular,
 # video-vga.o *must* be listed first, followed by video-vesa.o.
 # Hardware-specific drivers should follow in the order they should be
diff --git a/arch/x86/realmode/rm/a20.c b/arch/x86/realmode/rm/a20.c
new file mode 100644
index 0000000..e71d518
--- /dev/null
+++ b/arch/x86/realmode/rm/a20.c
@@ -0,0 +1 @@
+#include "../../boot/a20.c"
diff --git a/arch/x86/realmode/rm/wakemain.c b/arch/x86/realmode/rm/wakemain.c
index 91405d5..6e0d548 100644
--- a/arch/x86/realmode/rm/wakemain.c
+++ b/arch/x86/realmode/rm/wakemain.c
@@ -79,4 +79,7 @@ void main(void)
 		probe_cards(0);
 		set_mode(wakeup_header.video_mode);
 	}
+
+	/* If A20 is closed, fix now */
+	enable_a20();
 }
-- 
1.7.11.7


  reply	other threads:[~2012-12-10 21:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26  8:56 Ondrej Zary
2012-11-05 20:35 ` Ondrej Zary
2012-12-10 21:26   ` H. Peter Anvin [this message]
2012-12-10 22:51     ` Ondrej Zary
2012-12-11 18:59     ` Ondrej Zary
2012-12-11 19:07       ` H. Peter Anvin
2012-12-11 20:29         ` Ondrej Zary
2012-12-11 20:36           ` H. Peter Anvin
2012-12-11 20:50             ` Ondrej Zary
2012-12-11 20:56               ` H. Peter Anvin

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=50C6537A.9090303@zytor.com \
    --to=hpa@zytor.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    --cc=rjw@sisk.pl \
    /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

Powered by JetHome