Commit b46fe571 authored by Thomas Gleixner's avatar Thomas Gleixner

genirq: Cleanup forced threading bits when handler thread terminates

When a handler thread terminates then the forced_thread_active bit
might be still set. Cleanup and unmask the interrupt if this is the
last thread which blocked the unmask.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 570f410b
...@@ -537,6 +537,14 @@ static void preempt_hardirq_setup(struct irqaction *new) ...@@ -537,6 +537,14 @@ static void preempt_hardirq_setup(struct irqaction *new)
new->thread_fn = new->handler; new->thread_fn = new->handler;
new->handler = preempt_hardirq_handler; new->handler = preempt_hardirq_handler;
} }
static inline void
preempt_hardirq_cleanup(struct irq_desc *desc, struct irqaction *action)
{
clear_bit(IRQTF_RUNTHREAD, &action->thread_flags);
preempt_hardirq_thread_done(desc, action);
}
#else #else
static inline void preempt_hardirq_setup(struct irqaction *new) { } static inline void preempt_hardirq_setup(struct irqaction *new) { }
static inline int static inline int
...@@ -544,6 +552,8 @@ preempt_hardirq_thread_done(struct irq_desc *d, struct irqaction *a) ...@@ -544,6 +552,8 @@ preempt_hardirq_thread_done(struct irq_desc *d, struct irqaction *a)
{ {
return 0; return 0;
} }
static inline void
preempt_hardirq_cleanup(struct irq_desc *d, struct irqaction *a) { }
#endif #endif
static int static int
...@@ -639,6 +649,8 @@ static int irq_thread(void *data) ...@@ -639,6 +649,8 @@ static int irq_thread(void *data)
wake_up(&desc->wait_for_threads); wake_up(&desc->wait_for_threads);
} }
preempt_hardirq_cleanup(desc, action);
/* /*
* Clear irqaction. Otherwise exit_irq_thread() would make * Clear irqaction. Otherwise exit_irq_thread() would make
* fuzz about an active irq thread going into nirvana. * fuzz about an active irq thread going into nirvana.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment