Return-path: Received: from nbd.name ([46.4.11.11]:36373 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750797Ab2E2MoA (ORCPT ); Tue, 29 May 2012 08:44:00 -0400 Message-ID: <4FC4C47A.50006@openwrt.org> (sfid-20120529_144403_865324_FB9691FE) Date: Tue, 29 May 2012 14:43:38 +0200 From: Felix Fietkau MIME-Version: 1.0 To: Johannes Berg CC: Sujith Manoharan , linville@tuxdriver.com, linux-wireless@vger.kernel.org Subject: Re: [PATCH v2 09/22] ath9k: Handle fatal interrupts properly References: <20413.45797.72462.431840@gargle.gargle.HOWL> <4FC4C12A.1050804@openwrt.org> (sfid-20120529_142944_112351_CE560AC4) <1338294968.4342.32.camel@jlt3.sipsolutions.net> In-Reply-To: <1338294968.4342.32.camel@jlt3.sipsolutions.net> Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 2012-05-29 2:36 PM, Johannes Berg wrote: > On Tue, 2012-05-29 at 14:29 +0200, Felix Fietkau wrote: >> On 2012-05-24 6:02 AM, Sujith Manoharan wrote: >> > When a fatal interrupt is received or it is detected that the baseband >> > has hung, the chip has to be reset immediately. Otherwise, we end up >> > processing spurious interrupts. Ensure that we bail out properly in >> > the ISR when the reset work hasn't completed yet. >> > >> > Signed-off-by: Sujith Manoharan >> Wouldn't it be much easier to just use a bool variable instead of the >> combination of lock+flag? A simple variable assignment is atomic... > > Is that guaranteed for bool variables? Hm, good point. Maybe use u32 then. Either way, the lock in this patch does almost nothing to protect against race conditions, since it doesn't apply to other places in the code that change sc->sc_flags. Maybe we should change that entire thing to just use set_bit/test_bit instead. - Felix