Messages in this thread | | | Date | Mon, 10 Feb 2014 09:58:25 +0100 (CET) | From | Thomas Gleixner <> | Subject | Re: [PATCH 1/2] genirq: Fix the possible synchronize_irq() wait-forever |
| |
On Mon, 10 Feb 2014, Chuansheng Liu wrote: > There is below race between irq handler and irq thread: > irq handler irq thread > > irq_wake_thread() irq_thread() > set bit RUNTHREAD > ... clear bit RUNTHREAD > thread_fn() > [A]test_and_decrease > thread_active > [B]increase thread_active > > If action A is before action B, after that the thread_active > will be always > 0, and for synchronize_irq() calling, which > will be waiting there forever.
No. thread_active is 0, simply because after the atomic_dec_and_test() it is -1 and the atomic_inc on the other side will bring it back to 0.
Thanks,
tglx
| |