linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Prarit Bhargava <prarit@redhat.com>, linux-acpi@vger.kernel.org
Subject: [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled
Date: Thu,  8 Aug 2013 15:35:13 +0300	[thread overview]
Message-ID: <1375965314-24232-2-git-send-email-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <1375965314-24232-1-git-send-email-heikki.krogerus@linux.intel.com>

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.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/acpi/pci_irq.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 41c5e1b..902ed1c 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -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);
-- 
1.8.3.2


  reply	other threads:[~2013-08-08 12:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 12:35 [PATCH 0/2] ACPI: return error in acpi_pci_irq_enable when there is no irq Heikki Krogerus
2013-08-08 12:35 ` Heikki Krogerus [this message]
2013-08-08 13:57   ` [PATCH 1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled Rafael J. Wysocki
2013-08-12 21:14     ` Bjorn Helgaas
2013-08-12 21:32       ` Yinghai Lu
2013-08-12 22:32         ` Bjorn Helgaas
2013-08-23 17:00           ` Bjorn Helgaas
2013-10-03 23:58           ` Prarit Bhargava
2013-08-08 12:35 ` [PATCH 2/2] ACPI / PCI: remove an extra check from acpi_pci_irq_enable() Heikki Krogerus
2013-08-08 13:58   ` Rafael J. Wysocki
2013-08-12 21:15     ` Bjorn Helgaas
2013-09-13 12:52 ` [PATCH 0/2] ACPI: return error in acpi_pci_irq_enable when there is no irq Prarit Bhargava
2013-09-13 23:43   ` Rafael J. Wysocki
2013-09-13 23:55     ` Bjorn Helgaas
2013-09-16  7:40       ` Heikki Krogerus
2013-09-16 10:28         ` Heikki Krogerus

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=1375965314-24232-2-git-send-email-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=rjw@sisk.pl \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).