Patchwork [3.8.y.z,extended,stable] Patch "genirq: Fix can_request_irq() for IRQs without an action" has been added to staging queue

mail settings
Submitter Luis Henriques
Date July 9, 2013, 4:28 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/257802/
State New
Headers show


Luis Henriques - July 9, 2013, 4:28 p.m.
This is a note to let you know that I have just added a patch titled

    genirq: Fix can_request_irq() for IRQs without an action

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.8.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see



From 30ce4c8b736af2edc52017fe0f70e11748b19442 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <>
Date: Fri, 28 Jun 2013 02:40:30 +0100
Subject: [PATCH] genirq: Fix can_request_irq() for IRQs without an action

commit 2779db8d37d4b542d9ca2575f5f178dbeaca6c86 upstream.

Commit 02725e7471b8 ('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 <>
Tested-by: Bjarni Ingi Gislason <> (against 3.2)
Signed-off-by: Ben Hutchings <>
Signed-off-by: Thomas Gleixner <>
Signed-off-by: Luis Henriques <>
 kernel/irq/manage.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index e49a288..a9302d0 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -554,9 +554,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;