Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757970Ab2JXT5W (ORCPT ); Wed, 24 Oct 2012 15:57:22 -0400 Received: from mail-1.atlantis.sk ([80.94.52.57]:51144 "EHLO mail.atlantis.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756140Ab2JXT5S (ORCPT ); Wed, 24 Oct 2012 15:57:18 -0400 From: Ondrej Zary To: "H. Peter Anvin" Subject: Re: [PATCH] Enable A20 using KBC for some MSI laptops to fix S3 resume Date: Wed, 24 Oct 2012 21:56:42 +0200 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <201210240847.52417.linux@rainbow-software.org> <450396555.xT2D53NWjT@vostro.rjw.lan> <5e64035c-9ee0-4e76-a348-d4f9f6c7b198@email.android.com> In-Reply-To: <5e64035c-9ee0-4e76-a348-d4f9f6c7b198@email.android.com> X-KMail-QuotePrefix: > MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201210242156.43233.linux@rainbow-software.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4300 Lines: 143 On Wednesday 24 October 2012 21:36:04 H. Peter Anvin wrote: > Minor concern: it should do the wait for ready before sending each command. 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. > "Rafael J. Wysocki" wrote: > >On Wednesday 24 of October 2012 08:47:52 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. > >> > >> Tested with EX600 and PR200. > >> > >> Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878 > >> > >> Signed-off-by: Ondrej Zary > > > >Acked-by: Rafael J. Wysocki > > > >> --- a/arch/x86/kernel/acpi/boot.c > >> +++ b/arch/x86/kernel/acpi/boot.c > >> @@ -1349,6 +1349,20 @@ static int __init > > > >dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) > > > >> } > >> > >> /* > >> + * Enable A20 line using KBC even if it's already enabled using > > > >other method. > > > >> + * 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); > > > >> + 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 that acpi=force > >> * works for you, please contact linux-acpi@vger.kernel.org > >> */ > >> @@ -1423,6 +1437,60 @@ static struct dmi_system_id __initdata > > > >acpi_dmi_table[] = { > > > >> DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), > >> }, > >> }, > >> + /* > >> + * 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. > > > >> + */ > >> + { > >> + .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"), > >> + }, > >> + }, > >> {} > >> }; -- Ondrej Zary -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/