From patchwork Thu Feb 24 14:56:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Herrmann X-Patchwork-Id: 84643 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id BF426B70D6 for ; Sun, 27 Feb 2011 01:42:50 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PtLLt-00071R-3L; Sat, 26 Feb 2011 14:42:33 +0000 Received: from ch1outboundpool.messaging.microsoft.com ([216.32.181.181]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Pscd0-00057x-Mp for kernel-team@lists.ubuntu.com; Thu, 24 Feb 2011 14:57:14 +0000 Received: from mail7-ch1-R.bigfish.com (216.32.181.168) by CH1EHSOBE010.bigfish.com (10.43.70.60) with Microsoft SMTP Server id 14.1.225.8; Thu, 24 Feb 2011 14:57:13 +0000 Received: from mail7-ch1 (localhost.localdomain [127.0.0.1]) by mail7-ch1-R.bigfish.com (Postfix) with ESMTP id 81081B001A8; Thu, 24 Feb 2011 14:57:13 +0000 (UTC) X-SpamScore: -17 X-BigFish: VPS-17(z6c9Mz1431J1432N98dNzz1202hzz8275eh8275bh8275dha1495iz32i637h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI Received: from mail7-ch1 (localhost.localdomain [127.0.0.1]) by mail7-ch1 (MessageSwitch) id 1298559422818846_29174; Thu, 24 Feb 2011 14:57:02 +0000 (UTC) Received: from CH1EHSMHS028.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.248]) by mail7-ch1.bigfish.com (Postfix) with ESMTP id 9837E17800E3; Thu, 24 Feb 2011 14:57:01 +0000 (UTC) Received: from ausb3twp02.amd.com (163.181.249.109) by CH1EHSMHS028.bigfish.com (10.43.70.28) with Microsoft SMTP Server id 14.1.225.8; Thu, 24 Feb 2011 14:57:01 +0000 X-WSS-ID: 0LH4MUW-02-B4F-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 21265C881A; Thu, 24 Feb 2011 08:56:56 -0600 (CST) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.106.1; Thu, 24 Feb 2011 09:02:50 -0600 Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 24 Feb 2011 08:56:59 -0600 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.3.83.0; Thu, 24 Feb 2011 09:56:58 -0500 Received: from amd.com (alberich.osrc.amd.com [165.204.15.18]) by gwo.osrc.amd.com (Postfix) with SMTP id 6CB2949C0F9; Thu, 24 Feb 2011 14:56:57 +0000 (GMT) Received: by amd.com (nbSMTP-1.00) for uid 84919 reasand@amd.com; Thu, 24 Feb 2011 15:56:57 +0100 (CET) Date: Thu, 24 Feb 2011 15:56:57 +0100 From: Andreas Herrmann To: Stefan Bader Subject: Re: [PATCH] Quirk to fix suspend/resume on another Lenovo ThinkPad Edge, model 030246G. Message-ID: <20110224145657.GE3658@alberich.amd.com> References: <1297606666-13207-1-git-send-email-thomas@schwinge.name> <4D5930F3.5000309@canonical.com> <4D593BBE.80101@canonical.com> <874o862zq7.fsf@kepler.schwinge.homeip.net> <4D5B960E.5080605@canonical.com> <20110223145840.GB5063@alberich.amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110223145840.GB5063@alberich.amd.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginatorOrg: amd.com X-Mailman-Approved-At: Sat, 26 Feb 2011 14:42:31 +0000 Cc: "kernel-team@lists.ubuntu.com" , Thomas Schwinge X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com On Wed, Feb 23, 2011 at 03:58:40PM +0100, Andreas Herrmann wrote: > On Wed, Feb 16, 2011 at 04:17:02AM -0500, Stefan Bader wrote: > > Hi Andreas, > > > > I know there probably are already enough people poking you about when there > > might be a generic fix. Just wanted to point out that Thomas reported a SB880 > > (in case that makes a difference to SB800 that seemed to be reported before). > > Hi Stefan, > > patch is prepared. > Just want to have verified it on one known buggy system here. > I'll send it out by end of today or tomorrow. I've just submitted below patch to LKML (http://marc.info/?i=20110224145346.GD3658@alberich.amd.com) Andreas --- On some SB800 systems polarity for IOAPIC pin2 is wrongly specified as low active by BIOS. This caused system hangs after resume from S3 when HPET was used in one-shot mode on such systems because a timer interrupt was missed (HPET signal is high active). For more details see http://marc.info/?l=linux-kernel&m=129623757413868 Cc: stable@kernel.org # 37.x, 32.x Tested-by: Manoj Iyer Tested-by: Andre Przywara Signed-off-by: Andreas Herrmann --- arch/x86/include/asm/acpi.h | 1 + arch/x86/kernel/acpi/boot.c | 16 ++++++++++++---- arch/x86/kernel/early-quirks.c | 16 +++++++--------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 211ca3f..4ea15ca 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h @@ -88,6 +88,7 @@ extern int acpi_disabled; extern int acpi_pci_disabled; extern int acpi_skip_timer_override; extern int acpi_use_timer_override; +extern int acpi_fix_pin2_polarity; extern u8 acpi_sci_flags; extern int acpi_sci_override_gsi; diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index b3a7113..ff25db6 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -72,6 +72,7 @@ u8 acpi_sci_flags __initdata; int acpi_sci_override_gsi __initdata; int acpi_skip_timer_override __initdata; int acpi_use_timer_override __initdata; +int acpi_fix_pin2_polarity __initdata; #ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; @@ -415,10 +416,17 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header, return 0; } - if (acpi_skip_timer_override && - intsrc->source_irq == 0 && intsrc->global_irq == 2) { - printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); - return 0; + if (intsrc->source_irq == 0 && intsrc->global_irq == 2) { + if (acpi_skip_timer_override) { + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); + return 0; + } + if (acpi_fix_pin2_polarity && + (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { + intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK; + printk(PREFIX "BIOS IRQ0 pin2 override: " + "forcing polarity to high active.\n"); + } } mp_override_legacy_irq(intsrc->source_irq, diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 76b8cd9..9efbdcc 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -143,15 +143,10 @@ static void __init ati_bugs(int num, int slot, int func) static u32 __init ati_sbx00_rev(int num, int slot, int func) { - u32 old, d; + u32 d; - d = read_pci_config(num, slot, func, 0x70); - old = d; - d &= ~(1<<8); - write_pci_config(num, slot, func, 0x70, d); d = read_pci_config(num, slot, func, 0x8); d &= 0xff; - write_pci_config(num, slot, func, 0x70, old); return d; } @@ -160,13 +155,16 @@ static void __init ati_bugs_contd(int num, int slot, int func) { u32 d, rev; - if (acpi_use_timer_override) - return; - rev = ati_sbx00_rev(num, slot, func); + if (rev >= 0x40) + acpi_fix_pin2_polarity = 1; + if (rev > 0x13) return; + if (acpi_use_timer_override) + return; + /* check for IRQ0 interrupt swap */ d = read_pci_config(num, slot, func, 0x64); if (!(d & (1<<14)))