]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / PCI: acpi_pci_irq_enable() must return an error if ACPI cannot map an IRQ.
authorPrarit Bhargava <prarit@redhat.com>
Mon, 15 Jul 2013 14:57:40 +0000 (10:57 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Jul 2013 22:39:47 +0000 (00:39 +0200)
commitf12f16aa6e61312ef4c12cfaa9c81a3c59406397
treec28bcf1ea6e626fef6efaae36bcdea2db185cb07
parent1129c92faa069581bf3acf34cae92477bd6161d8
ACPI / PCI: acpi_pci_irq_enable() must return an error if ACPI cannot map an IRQ.

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>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/pci_irq.c