[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1402100951290.21991@ionos.tec.linutronix.de>
Date: Mon, 10 Feb 2014 09:58:25 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Chuansheng Liu <chuansheng.liu@...el.com>
cc: linux-kernel@...r.kernel.org,
xiaoming wang <xiaoming.wang@...el.com>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists