diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-03-15 17:55:21 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-03-16 06:27:28 -0400 |
commit | e04268b0effc0ceea366c50b3107baad9edadafa (patch) | |
tree | 0248960f688b504d819a2cf1c11218edec962597 /kernel/irq | |
parent | 7140ea1980f2fae9c7aaeac5f6b35317e1389ee6 (diff) |
genirq: Remove paranoid warnons and bogus fixups
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 <agordeev@redhat.com>
Cc: Ido Yariv <ido@wizery.com>
Link: http://lkml.kernel.org/r/20120315190755.GA6732@dhcp-26-207.brq.redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/manage.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 453feedbb390..b0ccd1ac2d6a 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -804,17 +804,11 @@ static int irq_thread(void *data) | |||
804 | * This is the regular exit path. __free_irq() is stopping the | 804 | * This is the regular exit path. __free_irq() is stopping the |
805 | * thread via kthread_stop() after calling | 805 | * thread via kthread_stop() after calling |
806 | * synchronize_irq(). So neither IRQTF_RUNTHREAD nor the | 806 | * synchronize_irq(). So neither IRQTF_RUNTHREAD nor the |
807 | * oneshot mask bit should be set. | 807 | * oneshot mask bit can be set. We cannot verify that as we |
808 | * cannot touch the oneshot mask at this point anymore as | ||
809 | * __setup_irq() might have given out currents thread_mask | ||
810 | * again. | ||
808 | * | 811 | * |
809 | * Verify that this is true. | ||
810 | */ | ||
811 | if (WARN_ON(test_and_clear_bit(IRQTF_RUNTHREAD, &action->thread_flags))) | ||
812 | wake_threads_waitq(desc); | ||
813 | |||
814 | if (WARN_ON(desc->threads_oneshot & action->thread_mask)) | ||
815 | irq_finalize_oneshot(desc, action, true); | ||
816 | |||
817 | /* | ||
818 | * Clear irq_thread. Otherwise exit_irq_thread() would make | 812 | * Clear irq_thread. Otherwise exit_irq_thread() would make |
819 | * fuzz about an active irq thread going into nirvana. | 813 | * fuzz about an active irq thread going into nirvana. |
820 | */ | 814 | */ |