All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Liwei <xieliwei@gmail.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: Re: "ACPI: Unable to start the ACPI Interpreter"
Date: Tue, 28 Jun 2011 15:27:51 -0400	[thread overview]
Message-ID: <20110628192751.GA24464@dumpdata.com> (raw)
In-Reply-To: <BANLkTik4d86tWOAyGfvo4mjY5q1dx3a_mQ@mail.gmail.com>

On Tue, Jun 28, 2011 at 11:33:17AM -0700, Liwei wrote:
> On 29 June 2011 02:12, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> 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;
 }

  reply	other threads:[~2011-06-28 19:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 18:55 "ACPI: Unable to start the ACPI Interpreter" Liwei
2011-06-25 12:33 ` Liwei
     [not found]   ` <20110627133936.GB6978@dumpdata.com>
2011-06-27 15:12     ` Liwei
2011-06-27 16:32       ` Konrad Rzeszutek Wilk
2011-06-27 16:59         ` Liwei
2011-06-27 17:33           ` Konrad Rzeszutek Wilk
2011-06-27 18:23             ` Liwei
2011-06-27 18:59               ` Konrad Rzeszutek Wilk
2011-06-27 19:10               ` Konrad Rzeszutek Wilk
2011-06-27 19:18                 ` Liwei
2011-06-27 19:30                   ` Konrad Rzeszutek Wilk
2011-06-27 20:32                     ` Liwei
2011-06-27 21:09                       ` Liwei
2011-06-28 18:12                         ` Konrad Rzeszutek Wilk
2011-06-28 18:33                           ` Liwei
2011-06-28 19:27                             ` Konrad Rzeszutek Wilk [this message]
2011-06-28 19:49                               ` Liwei
2011-06-28 19:51                                 ` Konrad Rzeszutek Wilk
2011-06-28 19:55                                   ` Liwei
2011-06-28 20:44                                     ` Konrad Rzeszutek Wilk
2011-06-29 13:09                                       ` Liwei
2011-06-29 13:37                                         ` Liwei
  -- strict thread matches above, loose matches on Subject: below --
2011-06-29 14:23 Konrad Wilk
2011-06-29 15:20 ` Liwei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110628192751.GA24464@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xieliwei@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.