Skip to contentSkip to conversation

ACPI: return error in acpi_pci_irq_enable when there is no irq

PATCH In review Heikki Krogerus 5 participants 16 messages Aug 8, 2013 – Oct 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ACPI: return error in acpi_pci_irq_enable when there is no irq

Hi,

This is the fix for the Dell PowerEdge 840 issue where nothing allocated an irq for it's PCH if I understood correctly. The issue was reported by Prarit Bhargava.

The second patch is just a minor cleanup.

Thanks,

Heikki Krogerus (2):
ACPI / PCI: don't allow PCI devices without irq to be enabled ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

 drivers/acpi/pci_irq.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/2 ACPI / PCI: don't allow PCI devices without irq to be enabled

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

---
 drivers/acpi/pci_irq.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/acpi/pci_irq.c +9 -1
index 41c5e1b..902ed1c 100644
@@ -419,8 +419,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 	 */
 	if (gsi < 0) {
 		u32 dev_gsi;
+
+		/* Not accepting 0 as valid PCI IRQ. */
+		if (!dev->irq) {
+			dev_err(&dev->dev, "PCI INT %c: no IRQ\n",
+				pin_name(pin));
+			return -ENOENT;
+		}
+
 		/* Interrupt Line values above 0xF are forbidden */
-		if (dev->irq > 0 && (dev->irq <= 0xF) &&
+		if ((dev->irq <= 0xF) &&
 		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
 			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
 				 pin_name(pin), dev->irq);
Signature · 1 line
1.8.3.2
#8 lore raw

PATCH 2/2 ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

In reply to Heikki Krogerus

acpi_isa_irq_to_gsi() will check if the irq is within accepted rage so there is no need to check it separately.

---
 drivers/acpi/pci_irq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/pci_irq.c +1 -3
index 902ed1c..e71e7fa 100644
@@ -427,9 +427,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 			return -ENOENT;
 		}
 
-		/* Interrupt Line values above 0xF are forbidden */
-		if ((dev->irq <= 0xF) &&
-		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
+		if (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0) {
 			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
 				 pin_name(pin), dev->irq);
 			acpi_register_gsi(&dev->dev, dev_gsi,
Signature · 1 line
1.8.3.2
#9 lore raw

Re: [PATCH 2/2] ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

Quoted 4 lines · Heikki Krogerus

acpi_isa_irq_to_gsi() will check if the irq is within accepted rage so there is no need to check it separately.

Hi Bjorn,

Does this look OK to you?

Rafael

Quoted 20 lines
---
 drivers/acpi/pci_irq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/pci_irq.c +1 -3
index 902ed1c..e71e7fa 100644
@@ -427,9 +427,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 			return -ENOENT;
 		}
 
-		/* Interrupt Line values above 0xF are forbidden */
-		if ((dev->irq <= 0xF) &&
-		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
+		if (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0) {
 			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
 				 pin_name(pin), dev->irq);
 			acpi_register_gsi(&dev->dev, dev_gsi,
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw

Re: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

In reply to Heikki Krogerus
Quoted 11 lines · Heikki Krogerus

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

Hi Bjorn,

Any objections to this?

Rafael

Quoted 27 lines
---
 drivers/acpi/pci_irq.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/acpi/pci_irq.c +9 -1
index 41c5e1b..902ed1c 100644
@@ -419,8 +419,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 	 */
 	if (gsi < 0) {
 		u32 dev_gsi;
+
+		/* Not accepting 0 as valid PCI IRQ. */
+		if (!dev->irq) {
+			dev_err(&dev->dev, "PCI INT %c: no IRQ\n",
+				pin_name(pin));
+			return -ENOENT;
+		}
+
 		/* Interrupt Line values above 0xF are forbidden */
-		if (dev->irq > 0 && (dev->irq <= 0xF) &&
+		if ((dev->irq <= 0xF) &&
 		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
 			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
 				 pin_name(pin), dev->irq);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
maintainer Acked-by
#3 lore raw

Re: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · Heikki Krogerus

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

Quoted 6 lines
Quoted 2 lines

Hi Bjorn,

Any objections to this?

Quoted 30 lines
Quoted 17 lines
---
 drivers/acpi/pci_irq.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/acpi/pci_irq.c +4 -0
index 41c5e1b..902ed1c 100644
@@ -419,8 +419,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
       */
      if (gsi < 0) {
              u32 dev_gsi;
+
+             /* Not accepting 0 as valid PCI IRQ. */
+             if (!dev->irq) {
+                     dev_err(&dev->dev, "PCI INT %c: no IRQ\n",

drivers/acpi/pci_irq.c int acpi_pci_irq_enable(struct pci_dev *dev) · line 434

Quoted 10 lines
drivers/acpi/pci_irq.c +5 -1
+                             pin_name(pin));
+                     return -ENOENT;
+             }
+
              /* Interrupt Line values above 0xF are forbidden */
-             if (dev->irq > 0 && (dev->irq <= 0xF) &&
+             if ((dev->irq <= 0xF) &&
                  (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
                      dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
                               pin_name(pin), dev->irq);

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

maintainer Acked-by
#10 lore raw

Re: [PATCH 2/2] ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

In reply to Rafael J. Wysocki
Quoted 9 lines · Rafael J. Wysocki
Quoted 4 lines · Heikki Krogerus

acpi_isa_irq_to_gsi() will check if the irq is within accepted rage so there is no need to check it separately.

Hi Bjorn,

Does this look OK to you?

Quoted 23 lines
Quoted 10 lines
---
 drivers/acpi/pci_irq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/pci_irq.c +0 -0
index 902ed1c..e71e7fa 100644

drivers/acpi/pci_irq.c int acpi_pci_irq_enable(struct pci_dev *dev) · line 433

Quoted 10 lines
drivers/acpi/pci_irq.c +1 -3
@@ -427,9 +427,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
                      return -ENOENT;
              }
 
-             /* Interrupt Line values above 0xF are forbidden */
-             if ((dev->irq <= 0xF) &&
-                 (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
+             if (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0) {
                      dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
                               pin_name(pin), dev->irq);
                      acpi_register_gsi(&dev->dev, dev_gsi,

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

#4 lore raw

Re: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

In reply to Bjorn Helgaas
Quoted 11 lines · Bjorn Helgaas
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines · Heikki Krogerus

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Hi Bjorn,

Any objections to this?

some USB3 host controller does not have intx configured, but still work with MSI?

Yinghai

maintainer
#5 lore raw

Re: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

Quoted 15 lines · Yinghai Lu
Quoted 14 lines · Bjorn Helgaas
Quoted 13 lines · Rafael J. Wysocki
Quoted 11 lines · Heikki Krogerus

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Bjorn,

Any objections to this?

some USB3 host controller does not have intx configured, but still work with MSI?

Huh, OK, I take back my ack, at least while we investigate this.

Bjorn

maintainer
#6 lore raw

Re: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Yinghai Lu
Quoted 16 lines · Bjorn Helgaas
Quoted 15 lines · Rafael J. Wysocki
Quoted 11 lines · Heikki Krogerus

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

Hi Bjorn,

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Any objections to this?

some USB3 host controller does not have intx configured, but still work with MSI?

Huh, OK, I take back my ack, at least while we investigate this.

Is anybody looking into this? I'm afraid I gave the impression that *I* would investigate this. But I don't really have enough information, and it would be better if the patch author and the reporter could investigate it first.

It would help if there were a bugzilla with complete dmesg log, acpidump, etc.

Bjorn

#11 lore raw
In reply to Heikki Krogerus
Quoted 6 lines · Heikki Krogerus

Hi,

This is the fix for the Dell PowerEdge 840 issue where nothing allocated an irq for it's PCH if I understood correctly. The issue was reported by Prarit Bhargava.

Quoted 9 lines

The second patch is just a minor cleanup.

Thanks,

Heikki Krogerus (2):
ACPI / PCI: don't allow PCI devices without irq to be enabled ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

Rafael, is this in your queue?

Thanks,

P.

#12 lore raw
Quoted 13 lines · Prarit Bhargava
Quoted 11 lines · Heikki Krogerus

Hi,

This is the fix for the Dell PowerEdge 840 issue where nothing allocated an irq for it's PCH if I understood correctly. The issue was reported by Prarit Bhargava.

The second patch is just a minor cleanup.

Thanks,

Quoted 6 lines
Quoted 4 lines

Heikki Krogerus (2):
ACPI / PCI: don't allow PCI devices without irq to be enabled ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

Rafael, is this in your queue?

No, it is not, because Bjorn wanted to debug this issue deeper as far as I could understand.

Bjorn?

maintainer
#13 lore raw

[+cc Yinghai]

Quoted 19 lines · Rafael J. Wysocki
Quoted 18 lines · Prarit Bhargava
Quoted 15 lines · Heikki Krogerus

Hi,

This is the fix for the Dell PowerEdge 840 issue where nothing allocated an irq for it's PCH if I understood correctly. The issue was reported by Prarit Bhargava.

The second patch is just a minor cleanup.

Thanks,

Heikki Krogerus (2):
ACPI / PCI: don't allow PCI devices without irq to be enabled ACPI / PCI: remove an extra check from acpi_pci_irq_enable()

Quoted 6 lines
Quoted 1 line

Rafael, is this in your queue?

No, it is not, because Bjorn wanted to debug this issue deeper as far as I could understand.

Bjorn?

Yes. Yinghai pointed out a possible issue ("some USB3 host controller does not have intx configured, but still work with MSI?"). I can't explain to you right now what that means, but I did look at it enough to think that there indeed might be a problem there.

So I asked [1] for a bugzilla with more info (dmesg, acpidump) so somebody could look at it. Actually, I was hoping Heikki or Prarit would look into it and address Yinghai's concern. Maybe there's no problem there, but we should at least look and explain *why* it's not a problem. And I would really like a kernel.org bugzilla with the info, in case this change turns out to have unintended consequences and we have to debug it again later.

Bjorn

[1] http://lkml.kernel.org/r/CAErSpo7KDY87QPLNwbufeUAFGBtvyGteDmk6AxqFXBOX0RaObw@mail.gmail.com

#14 lore raw
Quoted 15 lines · Bjorn Helgaas
Quoted 8 lines · Rafael J. Wysocki
Quoted 2 lines · Prarit Bhargava

Rafael, is this in your queue?

No, it is not, because Bjorn wanted to debug this issue deeper as far as I could understand.

Bjorn?

Yes. Yinghai pointed out a possible issue ("some USB3 host controller does not have intx configured, but still work with MSI?"). I can't explain to you right now what that means, but I did look at it enough to think that there indeed might be a problem there.

Quoted 7 lines

So I asked [1] for a bugzilla with more info (dmesg, acpidump) so somebody could look at it. Actually, I was hoping Heikki or Prarit would look into it and address Yinghai's concern. Maybe there's no problem there, but we should at least look and explain *why* it's not a problem. And I would really like a kernel.org bugzilla with the info, in case this change turns out to have unintended consequences and we have to debug it again later.

I'll ask Sarah (xHCI maintaner) for help in case she knows something and create a bug for this if needed.

I don't understand much about PCI, I need to study it a bit. Why would it be a problem to get the xHCI working with only MSI?

Thanks,

Signature · 1 line
heikki
#15 lore raw

Hi,

Quoted 24 lines · Heikki Krogerus
Quoted 15 lines · Bjorn Helgaas
Quoted 8 lines · Rafael J. Wysocki
Quoted 2 lines · Prarit Bhargava

Rafael, is this in your queue?

No, it is not, because Bjorn wanted to debug this issue deeper as far as I could understand.

Bjorn?

Yes. Yinghai pointed out a possible issue ("some USB3 host controller does not have intx configured, but still work with MSI?"). I can't explain to you right now what that means, but I did look at it enough to think that there indeed might be a problem there.

Quoted 7 lines

So I asked [1] for a bugzilla with more info (dmesg, acpidump) so somebody could look at it. Actually, I was hoping Heikki or Prarit would look into it and address Yinghai's concern. Maybe there's no problem there, but we should at least look and explain *why* it's not a problem. And I would really like a kernel.org bugzilla with the info, in case this change turns out to have unintended consequences and we have to debug it again later.

Quoted 5 lines

I'll ask Sarah (xHCI maintaner) for help in case she knows something and create a bug for this if needed.

I don't understand much about PCI, I need to study it a bit. Why would it be a problem to get the xHCI working with only MSI?

Sorry but I'll take it back. I don't understand the problem, so I can't really file a bug.

Just in case there is a misunderstanding, I'll explain the situation again. Right now there is no issue with xHCI controller driver. Prarit has Dell machine that apparently has buggy BIOS. He suggested a WA [1] for his issue, but that WA broke the xHCI on my Haswell machine. This patch fixed his issue and left my xHCI controller working.

Maybe it would make sense to create a bug for the original issue with the buggy BIOS on Prarit's Dell. Prarit, you need to file that one!

[1] http://permalink.gmane.org/gmane.linux.kernel.pci/23962

Signature · 1 line
heikki
#7 lore raw

Re: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

In reply to Bjorn Helgaas
Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Yinghai Lu
Quoted 16 lines · Bjorn Helgaas
Quoted 15 lines · Rafael J. Wysocki
Quoted 11 lines · Heikki Krogerus

If there is no ACPI entry for the irq, returning error from acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his Dell PowerEdge 840 has buggy BIOS that does not supply ACPI entries for irq with some devices. That lead into kernel generating a warning "genirq: Flags mismatch irq 0...". This will fix that issue.

Hi Bjorn,

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Any objections to this?

some USB3 host controller does not have intx configured, but still work with MSI?

Huh, OK, I take back my ack, at least while we investigate this.

Bjorn, as suggested I've opened up a BZ here:

https://bugzilla.kernel.org/show_bug.cgi?id=62521

I've only cc'd yourself and Rafael. Heikki -- I didn't find an account under your intel.com address ...

P.