From 55bc26bc5c057d7e9c2cc11e7228cd97270ab786 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 13 Aug 2009 13:05:10 -0700 Subject: [PATCH] --- yaml --- r: 156749 b: refs/heads/master c: 2d860ad76f4ee4d2eba0fe3797c8d7cdce432cc0 h: refs/heads/master i: 156747: 7912aa34a00296d4904afb5956a83d76d3dd0696 v: v3 --- [refs] | 2 +- trunk/kernel/irq/manage.c | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index aba9f924abe5..2bbee860319d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3493e84de60590d3012139187f631f2dfbf0887f +refs/heads/master: 2d860ad76f4ee4d2eba0fe3797c8d7cdce432cc0 diff --git a/trunk/kernel/irq/manage.c b/trunk/kernel/irq/manage.c index 61c679db4687..d222515a5a06 100644 --- a/trunk/kernel/irq/manage.c +++ b/trunk/kernel/irq/manage.c @@ -761,7 +761,6 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) { struct irq_desc *desc = irq_to_desc(irq); struct irqaction *action, **action_ptr; - struct task_struct *irqthread; unsigned long flags; WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); @@ -809,9 +808,6 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) desc->chip->disable(irq); } - irqthread = action->thread; - action->thread = NULL; - spin_unlock_irqrestore(&desc->lock, flags); unregister_handler_proc(irq, action); @@ -819,12 +815,6 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) /* Make sure it's not being used on another CPU: */ synchronize_irq(irq); - if (irqthread) { - if (!test_bit(IRQTF_DIED, &action->thread_flags)) - kthread_stop(irqthread); - put_task_struct(irqthread); - } - #ifdef CONFIG_DEBUG_SHIRQ /* * It's a shared IRQ -- the driver ought to be prepared for an IRQ @@ -840,6 +830,13 @@ static struct irqaction *__free_irq(unsigned int irq, void *dev_id) local_irq_restore(flags); } #endif + + if (action->thread) { + if (!test_bit(IRQTF_DIED, &action->thread_flags)) + kthread_stop(action->thread); + put_task_struct(action->thread); + } + return action; }