aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/manager.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-06-27 18:57:14 -0400
committerAndi Kleen <andi@basil.nowhere.org>2008-07-16 17:27:07 -0400
commitd5ebde6ef5c2d51828f975a81d7d0e58bccfd833 (patch)
tree04563a7350dfc83784c77c16d0c3d49120dc05ad /drivers/pnp/manager.c
parent2d29a7a794c5bae982955cd5dd0a76e766e57f39 (diff)
PNP: support optional IRQ resources
This patch adds an IORESOURCE_IRQ_OPTIONAL flag for use when assigning resources to a device. If the flag is set and we are unable to assign an IRQ to the device, we can leave the IRQ disabled but allow the overall resource allocation to succeed. Some devices request an IRQ, but can run without an IRQ (possibly with degraded performance). This flag lets us run the device without the IRQ instead of just leaving the device disabled. This is a reimplementation of this previous change by Rene Herman <rene.herman@gmail.com>: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b73a223661ed137c5d3d2635f954382e94f5a43 I reimplemented this for two reasons: - to prepare for converting all resource options into a single linked list, as opposed to the per-resource-type lists we have now, and - to preserve the order and number of resource options. In PNPBIOS and ACPI, we configure a device by giving firmware a list of resource assignments. It is important that this list has exactly the same number of resources, in the same order, as the "template" list we got from the firmware in the first place. The problem of a sound card MPU401 being left disabled for want of an IRQ was reported by Uwe Bugla <uwe.bugla@gmx.de>. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/manager.c')
-rw-r--r--drivers/pnp/manager.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 7ea9e1e28003..a20accb5ef8f 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -153,6 +153,15 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
153 goto __add; 153 goto __add;
154 } 154 }
155 } 155 }
156
157 if (rule->flags & IORESOURCE_IRQ_OPTIONAL) {
158 res->start = -1;
159 res->end = -1;
160 res->flags |= IORESOURCE_DISABLED;
161 dev_dbg(&dev->dev, " irq %d disabled (optional)\n", idx);
162 goto __add;
163 }
164
156 dev_dbg(&dev->dev, " couldn't assign irq %d\n", idx); 165 dev_dbg(&dev->dev, " couldn't assign irq %d\n", idx);
157 return -EBUSY; 166 return -EBUSY;
158 167