Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156749
b: refs/heads/master
c: 2d860ad
h: refs/heads/master
i:
  156747: 7912aa3
v: v3
  • Loading branch information
Linus Torvalds authored and Thomas Gleixner committed Aug 13, 2009
1 parent db74e2e commit 55bc26b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3493e84de60590d3012139187f631f2dfbf0887f
refs/heads/master: 2d860ad76f4ee4d2eba0fe3797c8d7cdce432cc0
17 changes: 7 additions & 10 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -809,22 +808,13 @@ 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);

/* 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
Expand All @@ -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;
}

Expand Down

0 comments on commit 55bc26b

Please sign in to comment.