Re: [PATCH] Enable A20 using KBC for some MSI laptops to fix S3 resume
From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2012-10-24 20:04:11
Also in:
lkml
Probably should. Ondrej Zary [off-list ref] wrote:
On Wednesday 24 October 2012 21:36:04 H. Peter Anvin wrote:quoted
Minor concern: it should do the wait for ready before sending eachcommand. It was a hack and then I forgot to add the waits... Should I redo the patch? I'll not be able to test it as I have to return the machine.quoted
"Rafael J. Wysocki" [off-list ref] wrote:quoted
On Wednesday 24 of October 2012 08:47:52 Ondrej Zary wrote:quoted
Some MSI laptop BIOSes are broken - INT 15h code uses port 92h toenable A20quoted
line but resume code assumes that KBC was used. The laptop will not resume from S3 otherwise but powers off afteraquoted
quoted
whilequoted
and then powers on again stuck with a blank screen. Fix it by enabling A20 using KBC. Affected laptop list and DMIdataquoted
quoted
are fromquoted
bug reports at Ubuntu Launchpad. Tested with EX600 and PR200. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878 Signed-off-by: Ondrej Zary <redacted>Acked-by: Rafael J. Wysocki <redacted>quoted
--- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c@@ -1349,6 +1349,20 @@ static int __initdmi_ignore_irq0_timer_override(const struct dmi_system_id *d)quoted
} /* + * Enable A20 line using KBC even if it's already enabled usingother method.quoted
+ * This is needed for some MSI laptops to resume from S3. + */ +static int __init a20_enable_kbc(const struct dmi_system_id *d) +{ + printk(KERN_NOTICE "%s detected: enabling A20 using KBC\n",d->ident);quoted
+ outb(0xd1, 0x64); /* Command write */ + outb(0xdf, 0x60); /* A20 on */ + outb(0xff, 0x64); /* Null command, but UHCI wants it */ + + return 0; +} + +/* * If your system is blacklisted here, but you find thatacpi=forcequoted
quoted
quoted
* works for you, please contact linux-acpi@vger.kernel.org */@@ -1423,6 +1437,60 @@ static struct dmi_system_id __initdataacpi_dmi_table[] = {quoted
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), }, }, + /* + * Some MSI laptop BIOSes are broken - INT 15h code uses port92hquoted
quoted
toquoted
+ * 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 blankscreen.quoted
+ */ + { + .callback = a20_enable_kbc, + .ident = "MSI EX600 Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "MSI Notebook EX600"), + }, + }, + { + .callback = a20_enable_kbc, + .ident = "MSI EX700 Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "EX700"), + }, + }, + { + .callback = a20_enable_kbc, + .ident = "MSI GX700 Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "GX700"), + }, + }, + { + .callback = a20_enable_kbc, + .ident = "MSI VR201 Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "MSI Notebook VR201"), + }, + }, + { + .callback = a20_enable_kbc, + .ident = "MSI VR601 Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "MSI Notebook VR601"), + }, + }, + { + .callback = a20_enable_kbc, + .ident = "MSI PR200 Laptop", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "MSI Notebook PR200"), + }, + }, {} };
-- Sent from my mobile phone. Please excuse brevity and lack of formatting.