From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Re: "ACPI: Unable to start the ACPI Interpreter" Date: Tue, 28 Jun 2011 15:27:51 -0400 Message-ID: <20110628192751.GA24464@dumpdata.com> References: <20110627173330.GC2430@dumpdata.com> <20110627191031.GD15703@dumpdata.com> <20110627193051.GA14665@dumpdata.com> <20110628181240.GA32393@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Liwei Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On Tue, Jun 28, 2011 at 11:33:17AM -0700, Liwei wrote: > On 29 June 2011 02:12, Konrad Rzeszutek Wilk wrote: > > On Tue, Jun 28, 2011 at 05:09:55AM +0800, Liwei wrote: > >> Hmm, here's the mapped IRQ list, interestingly IRQ 20 is on the list but not 9? > > > > Looks like it. You are also in luck - I found a machine that has the same > > exact problem and while it does not bail out when installing the ACPI interpreter > > it does get the wrong IRQs for the rest of the devices. > > > > In other words, I can reproduce it here. > > > > Good to hear. > > Would you be able to CC me when you have a patch available so that I Of course. > can test it out? I found out that the 3.0 kernel is somehow much more Here it is. diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index aac866e..09077b3 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -344,6 +344,7 @@ static int xen_register_pirq(u32 gsi, int triggering) struct physdev_map_pirq map_irq; int shareable = 0; char *name; + bool gsi_override = false; if (!xen_pv_domain()) return -1; @@ -360,11 +361,23 @@ static int xen_register_pirq(u32 gsi, int triggering) if (pirq < 0) goto out; - irq = xen_bind_pirq_gsi_to_irq(gsi, pirq, shareable, name); + /* We are installing the ACPI SCI */ + if (gsi == acpi_sci_override_gsi) { + /* Check whether the GSI != IRQ */ + acpi_gsi_to_irq(gsi, &irq); + printk(KERN_DEBUG "ACPI SCI GSI is %d, and ACPI IRQ thinks it is %d\n", gsi, irq); + if (irq != gsi) + /* Bugger, we MUST have that IRQ. */ + gsi_override = true; + } + if (gsi_override) + irq = xen_bind_pirq_gsi_to_irq(irq, pirq, shareable, name); + else + irq = xen_bind_pirq_gsi_to_irq(gsi, pirq, shareable, name); if (irq < 0) goto out; - printk(KERN_DEBUG "xen: --> pirq=%d -> irq=%d\n", pirq, irq); + printk(KERN_DEBUG "xen: --> pirq=%d -> gsi=%d -> irq=%d\n", pirq, gsi, irq); map_irq.domid = DOMID_SELF; map_irq.type = MAP_PIRQ_TYPE_GSI; @@ -414,6 +427,7 @@ static __init void xen_setup_acpi_sci(void) int rc; int trigger, polarity; int gsi = acpi_sci_override_gsi; + int irq = gsi; if (!gsi) return; @@ -426,12 +440,14 @@ static __init void xen_setup_acpi_sci(void) } trigger = trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE; polarity = polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH; - + + acpi_gsi_to_irq(gsi, &irq); + printk(KERN_INFO "xen: sci override: global_irq=%d trigger=%d " - "polarity=%d\n", gsi, trigger, polarity); + "polarity=%d irq %d\n", gsi, trigger, polarity, irq); gsi = xen_register_gsi(gsi, trigger, polarity); - printk(KERN_INFO "xen: acpi sci %d\n", gsi); + printk(KERN_INFO "xen: acpi sci %d -> irq %d\n", gsi, irq); return; }