Skip to content

Commit

Permalink
genirq: Fix can_request_irq() for IRQs without an action
Browse files Browse the repository at this point in the history
Commit 02725e7 ('genirq: Use irq_get/put functions'),
inadvertently changed can_request_irq() to return 0 for IRQs that have
no action.  This causes pcibios_lookup_irq() to select only IRQs that
already have an action with IRQF_SHARED set, or to fail if there are
none.  Change can_request_irq() to return 1 for IRQs that have no
action (if the first two conditions are met).

Reported-by: Bjarni Ingi Gislason <[email protected]>
Tested-by: Bjarni Ingi Gislason <[email protected]> (against 3.2)
Signed-off-by: Ben Hutchings <[email protected]>
Cc: [email protected]
Cc: [email protected] # 2.6.39+
Link: http://bugs.debian.org/709647
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
bwhacks authored and KAGA-KOKO committed Jun 28, 2013
1 parent b8394de commit 2779db8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ int can_request_irq(unsigned int irq, unsigned long irqflags)
return 0;

if (irq_settings_can_request(desc)) {
if (desc->action)
if (irqflags & desc->action->flags & IRQF_SHARED)
canrequest =1;
if (!desc->action ||
irqflags & desc->action->flags & IRQF_SHARED)
canrequest = 1;
}
irq_put_desc_unlock(desc, flags);
return canrequest;
Expand Down

0 comments on commit 2779db8

Please sign in to comment.