projects/linux·commit e04268b0

genirq: Remove paranoid warnons and bogus fixups

e04268b0 · Thomas Gleixner <[email protected]> · 2012-03-15 22:55:21 +01:00

Alexander pointed out that the warnons in the regular exit path are
bogus and the thread_mask one actually could be triggered when
__setup_irq() hands out that thread_mask again after __free_irq()
dropped irq_desc->lock.

Thinking more about it, neither IRQTF_RUNTHREAD nor the bit in
thread_mask can be set as this is the regular exit path. We come here
due to:
	__free_irq()
	   remove action from desc
	   synchronize_irq()
	   kthread_stop()

So synchronize_irq() makes sure that the thread finished running and
cleaned up both the thread_active count and thread_mask. After that
point nothing can set IRQTF_RUNTHREAD on this action. So the warnons
and the cleanups are pointless.

Reported-by: Alexander Gordeev <[email protected]>
Cc: Ido Yariv <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Commit
e04268b0effc0ceea366c50b3107baad9edadafa
Parents
7140ea19

Changes

1 files changed · +4 −10

FileStatusAddDelContent
kernel/irq/manage.cmodified+4−10View file

kernel/irq/manage.c

View file
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 453feed..b0ccd1a 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -804,17 +804,11 @@ static int irq_thread(void *data)
* This is the regular exit path. __free_irq() is stopping the
* thread via kthread_stop() after calling
* synchronize_irq(). So neither IRQTF_RUNTHREAD nor the
- * oneshot mask bit should be set.
+ * oneshot mask bit can be set. We cannot verify that as we
+ * cannot touch the oneshot mask at this point anymore as
+ * __setup_irq() might have given out currents thread_mask
+ * again.
*
- * Verify that this is true.
- */
- if (WARN_ON(test_and_clear_bit(IRQTF_RUNTHREAD, &action->thread_flags)))
- wake_threads_waitq(desc);
-
- if (WARN_ON(desc->threads_oneshot & action->thread_mask))
- irq_finalize_oneshot(desc, action, true);
-
- /*
* Clear irq_thread. Otherwise exit_irq_thread() would make
* fuzz about an active irq thread going into nirvana.
*/