Return-path: Received: from nbd.name ([46.4.11.11]:52154 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258Ab1H3Q6j (ORCPT ); Tue, 30 Aug 2011 12:58:39 -0400 Message-ID: <4E5D16B9.6030809@openwrt.org> (sfid-20110830_185842_831259_6054E4F8) Date: Tue, 30 Aug 2011 18:58:33 +0200 From: Felix Fietkau MIME-Version: 1.0 To: Rajkumar Manoharan CC: linux-wireless@vger.kernel.org, linville@tuxdriver.com, rodrigue@qca.qualcomm.com, shafi.wireless@gmail.com, vthiagar@qca.qualcomm.com Subject: Re: [PATCH v9 2/4] ath9k: always call ath_reset from workqueue context References: <1314693047-77839-1-git-send-email-nbd@openwrt.org> <1314693047-77839-2-git-send-email-nbd@openwrt.org> <20110830142008.GA9158@vmraj-lnx.users.atheros.com> <4E5D0722.7010606@openwrt.org> <20110830165402.GA9333@vmraj-lnx.users.atheros.com> In-Reply-To: <20110830165402.GA9333@vmraj-lnx.users.atheros.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Sender: linux-wireless-owner@vger.kernel.org List-ID: On 2011-08-30 6:54 PM, Rajkumar Manoharan wrote: > On Tue, Aug 30, 2011 at 05:52:02PM +0200, Felix Fietkau wrote: >> On 2011-08-30 4:20 PM, Rajkumar Manoharan wrote: >> >On Tue, Aug 30, 2011 at 10:30:45AM +0200, Felix Fietkau wrote: >> >> This makes it much easier to add further rework to avoid race conditions >> >> between reset and other work items. >> >> Move other functions to make ath_reset static. >> >> >> >> Signed-off-by: Felix Fietkau >> >> --- >> >> diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c >> >> index 49b93c2..2b2a975 100644 >> >> --- a/drivers/net/wireless/ath/ath9k/xmit.c >> >> +++ b/drivers/net/wireless/ath/ath9k/xmit.c >> >> @@ -581,8 +581,10 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, >> >> >> >> rcu_read_unlock(); >> >> >> >> - if (needreset) >> >> - ath_reset(sc, false); >> >> + if (needreset) { >> >> + sc->sc_flags |= SC_OP_HW_RESET; >> >> + ieee80211_queue_work(sc->hw,&sc->hw_reset_work); >> >> + } >> >> } >> >> >> >Still ath_txq_schedule can be scheduled. Return a error code from >> >ath_tx_complete_aggr to abort tx process intead of SC_OP_HW_RESET. >> >That looks much more generic and simple. >> I added this to make sure that there won't be any subsequent >> attempts at processing the tx queue until the reset (e.g. if there >> was a tx status IRQ in the mean time). >> > If so, it would be safer not to re-enable interrupts at the end of ath9k_tasklet > if SC_OP_HW_RESET is set. I think tx is the primary issue here, so I only added the check to the tx processing functions. - Felix