irq: DEBUG_SHIRQ executed on irq setup failure
PATCH 1/1 irq: DEBUG_SHIRQ executed on irq setup failure
When requesting an IRQ, the DEBUG_SHIRQ code executes a fake IRQ just to make sure the driver is ready to receive an IRQ immediately. The problem was that this fake IRQ was being executed even if interrupt line failed to be allocated by __setup_irq.
Signed-off-by Luis Henriques <[email protected]>
--- kernel/irq/manage.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/irq/manage.c +1 -1
@@ -914,7 +914,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,kfree (action);#ifdef CONFIG_DEBUG_SHIRQ -if (irqflags &IRQF_SHARED ) { +if (retval && (irqflags &IRQF_SHARED )) {/* * It's a shared IRQ -- the driver ought to be prepared for it * to happen immediately, so let's make sure....
Signature · 1 line
1.6.2.1
Quoted 4 lines · Luis Henriques
When requesting an IRQ, the
DEBUG_SHIRQcode executes a fake IRQ just to make sure the driver is ready to receive an IRQ immediately. The problem was that this fake IRQ was being executed even if interrupt line failed to be allocated by__setup_irq.
Good point !
Quoted 10 lines
Signed-off-by Luis Henriques <[email protected]>--- kernel/irq/manage.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/irq/manage.c +0
-0
kernel/irq/manage.c int request_threaded_irq(unsigned int irq, irq_handler_t handler, · line 917
Quoted 5 lines
kernel/irq/manage.c +1
-1@@ -914,7 +914,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,kfree (action);#ifdef CONFIG_DEBUG_SHIRQ -if (irqflags &IRQF_SHARED ) { +if (retval && (irqflags &IRQF_SHARED )) {
!retval might actually prevent the situation you described above :)
Thanks,
tglx