From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: 2.6.19-rc <-> ThinkPads Date: Wed, 1 Nov 2006 20:34:05 +0100 Message-ID: <200611012034.06128.ak@suse.de> References: <200611011825.47710.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from ns1.suse.de ([195.135.220.2]:22708 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S2992753AbWKATeV (ORCPT ); Wed, 1 Nov 2006 14:34:21 -0500 In-Reply-To: Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Linus Torvalds Cc: "Michael S. Tsirkin" , Ernst Herzberg , Len Brown , Adrian Bunk , Hugh Dickins , Pavel Machek , Andrew Morton , Linux Kernel Mailing List , linux-acpi@vger.kernel.org, linux-pm@osdl.org, Martin Lorenz On Wednesday 01 November 2006 19:25, Linus Torvalds wrote: > > On Wed, 1 Nov 2006, Andi Kleen wrote: > > > > Ok please revert the i386 patch for now then if it fixes the ThinkPads. > > The x86-64 version should be probably fixed too, but doesn't cleanly. I will > > send you later a patch to fix this there properly. > > Actually, I should have just fixed the ordering. I did some cleanups too, > but those are unrelated (except in the sense that I wanted to look at the > assembly code, and the cleanups made the code generation at least half-way > sane!) Thanks. Some of them are still different than the old code now, but that's probably ok. But the irq race you pointed out is still there (unless you fixed it in a differnet patch) I don't know if it makes a difference, but here is a patch to fix it. -Andi Fix race in IO-APIC routing entry setup. Interrupt could happen between setting the IO-APIC entry and setting its interrupt data. Pointed out by Linus. Signed-off-by: Andi Kleen Index: linux/arch/i386/kernel/io_apic.c =================================================================== --- linux.orig/arch/i386/kernel/io_apic.c +++ linux/arch/i386/kernel/io_apic.c @@ -1298,10 +1298,12 @@ static void __init setup_IO_APIC_irqs(vo if (!apic && (irq < 16)) disable_8259A_irq(irq); } + local_irq_save(flags); ioapic_write_entry(apic, pin, entry); - spin_lock_irqsave(&ioapic_lock, flags); + spin_lock(&ioapic_lock); set_native_irq_info(irq, TARGET_CPUS); - spin_unlock_irqrestore(&ioapic_lock, flags); + spin_unlock(&ioapic_lock); + local_irq_restore(flags); } }