lkml.org 
[lkml]   [2014]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-02-14 10:41    [W:0.089 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site