From: Prarit Bhargava <prarit@redhat.com>
To: linux-acpi@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>, Len Brown <lenb@kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Bjorn Helgaas <bhelgaas@google.com>,
Myron Stowe <mstowe@redhat.com>,
linux-pci@vger.kernel.org
Subject: [PATCH] acpi, acpi_pci_irq_enable must return an error if ACPI cannot map an IRQ.
Date: Mon, 15 Jul 2013 10:57:40 -0400 [thread overview]
Message-ID: <1373900260-1599-1-git-send-email-prarit@redhat.com> (raw)
Driver probe's currently do the following
pci_enable_device();
/* ... do some other init stuff, and eventually call ... */
request_irq();
After pci_enable_device() is called it is assumed that the device's irq
value (pci_dev->irq) has been appropriately set on success. This value
is passed into the request_irq() call.
In the case that ACPI is used to determine the irq value, it is possible
that the ACPI IRQ look up for a specific device fails and success is
returned by pci_enable_device().
The call sequence is:
pci_enable_device();
-> pci_enable_device_flags();
->do_pci_enable_device();
-> pcibios_enable_device() which, if the device
does not use MSI calls
-> pcibios_enable_irq() which maps to
acpi_pci_irq_enable()
-> acpi_pci_irq_lookup()
If acpi_pci_irq_lookup() cannot map the device's IRQ value it returns NULL
as an error. The error is returned to acpi_pci_irq_enable(), but is not
propagated further. This can result in the driver returning success for
pci_enable_device() and the driver probe attempting to call request_irq()
with dev->irq = 0.
This patch modifies acpi_pci_irq_enable() to return an error in the case
that an entry is not found in the ACPI tables.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>
Cc: "Myron Stowe" <mstowe@redhat.com>
Cc: linux-pci@vger.kernel.org
---
drivers/acpi/pci_irq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 41c5e1b..9681847 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -430,6 +430,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
} else {
dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
pin_name(pin));
+ return -ENOENT;
}
return 0;
--
1.7.9.3
next reply other threads:[~2013-07-15 14:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 14:57 Prarit Bhargava [this message]
2013-07-24 23:35 ` [PATCH] acpi, acpi_pci_irq_enable must return an error if ACPI cannot map an IRQ Rafael J. Wysocki
2013-07-25 0:01 ` Prarit Bhargava
2013-07-25 9:57 ` Prarit Bhargava
2013-07-25 12:10 ` Rafael J. Wysocki
2013-08-04 23:35 ` Prarit Bhargava
2013-08-05 13:30 ` Rafael J. Wysocki
2013-08-05 14:04 ` Heikki Krogerus
2013-08-06 14:37 ` Prarit Bhargava
2013-08-06 22:44 ` Rafael J. Wysocki
2013-08-07 12:39 ` Prarit Bhargava
2013-08-07 13:29 ` Heikki Krogerus
2013-08-07 23:04 ` Rafael J. Wysocki
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=1373900260-1599-1-git-send-email-prarit@redhat.com \
--to=prarit@redhat.com \
--cc=bhelgaas@google.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mstowe@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).