From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www.linutronix.de ([62.245.132.108]:56996 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbaHZVVP (ORCPT ); Tue, 26 Aug 2014 17:21:15 -0400 Date: Tue, 26 Aug 2014 23:20:41 +0200 (CEST) From: Thomas Gleixner To: Mika Westerberg cc: Jiang Liu , Benjamin Herrenschmidt , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Bjorn Helgaas , Randy Dunlap , Yinghai Lu , Borislav Petkov , Grant Likely , x86@kernel.org, Prarit Bhargava , Konrad Rzeszutek Wilk , Andrew Morton , Tony Luck , Joerg Roedel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, Ingo Molnar Subject: Re: [Bugfix] x86, irq: Fix bug in setting IOAPIC pin attributes In-Reply-To: <20140826095221.GO1660@lahna.fi.intel.com> Message-ID: References: <20140822124145.GF1660@lahna.fi.intel.com> <1409042706-11958-1-git-send-email-jiang.liu@linux.intel.com> <20140826095221.GO1660@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-pci-owner@vger.kernel.org List-ID: On Tue, 26 Aug 2014, Mika Westerberg wrote: > On Tue, Aug 26, 2014 at 04:45:01PM +0800, Jiang Liu wrote: > > On startup, IOAPIC driver preallocates IRQ descriptors and programs > > IOAPIC pins with default level and polarity attributes for all legacy > > IRQs. Later legacy IRQ users may fail to set IOAPIC pin attributes > > if the requested attributes conflicts with the default IOAPIC pin > > attributes. So change mp_irqdomain_map() to allow the first legacy IRQ > > user to reprogram IOAPIC pin with different attributes. > > > > Signed-off-by: Jiang Liu > > I tried this and now we get further in setting up the IOAPIC but it > still doesn't work :-( > > I noticed that mp_set_gsi_attr() never programs the IOAPIC in case > info->set is 0 so I added following on top of your patch. With the below > patch, the system seems to work as expected. > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c > index 66c2700c9f83..777762a0ad09 100644 > --- a/arch/x86/kernel/apic/io_apic.c > +++ b/arch/x86/kernel/apic/io_apic.c > @@ -3942,10 +3942,16 @@ int mp_set_gsi_attr(u32 gsi, int trigger, int polarity, int node) > > mutex_lock(&ioapic_mutex); > if (!info->set) { > + struct io_apic_irq_attr attr; > + > info->trigger = trigger; > info->polarity = polarity; > info->node = node; > info->set = 1; > + > + /* Now program the IOAPIC with the new attributes */ > + set_io_apic_irq_attr(&attr, ioapic, pin, trigger, polarity); > + ret = io_apic_setup_irq_pin(gsi, node, &attr); > } else if (info->trigger != trigger || info->polarity != polarity) { > ret = -EBUSY; > } Can someone please combine this into a single patch with a proper changelog? Thanks, tglx