From 4aa408abb679852e6195bf35a3a3d3cfd5c0f56b Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Thu, 21 Aug 2008 22:58:28 +0400 Subject: [PATCH] --- yaml --- r: 116380 b: refs/heads/master c: 377bf1e4ac2d894791733270604594c7c851ef83 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/irq/manage.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 5073e08e18fa..c4e77654832a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8d00a6c8f6b08e7167bc03bf955cdc7e47c5132e +refs/heads/master: 377bf1e4ac2d894791733270604594c7c851ef83 diff --git a/trunk/kernel/irq/manage.c b/trunk/kernel/irq/manage.c index 77a51be36010..ae1b684e048c 100644 --- a/trunk/kernel/irq/manage.c +++ b/trunk/kernel/irq/manage.c @@ -596,26 +596,29 @@ int request_irq(unsigned int irq, irq_handler_t handler, action->next = NULL; action->dev_id = dev_id; + retval = setup_irq(irq, action); + if (retval) + kfree(action); + #ifdef CONFIG_DEBUG_SHIRQ if (irqflags & IRQF_SHARED) { /* * It's a shared IRQ -- the driver ought to be prepared for it * to happen immediately, so let's make sure.... - * We do this before actually registering it, to make sure that - * a 'real' IRQ doesn't run in parallel with our fake + * We disable the irq to make sure that a 'real' IRQ doesn't + * run in parallel with our fake. */ unsigned long flags; + disable_irq(irq); local_irq_save(flags); + handler(irq, dev_id); + local_irq_restore(flags); + enable_irq(irq); } #endif - - retval = setup_irq(irq, action); - if (retval) - kfree(action); - return retval; } EXPORT_SYMBOL(request_irq);