From patchwork Fri Dec 3 04:07:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Kossifidis X-Patchwork-Id: 376651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB347aQO013823 for ; Fri, 3 Dec 2010 04:07:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757874Ab0LCEHf (ORCPT ); Thu, 2 Dec 2010 23:07:35 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:62183 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003Ab0LCEHf (ORCPT ); Thu, 2 Dec 2010 23:07:35 -0500 Received: by eye27 with SMTP id 27so4779063eye.19 for ; Thu, 02 Dec 2010 20:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=iesl9fRUNBldJF4ipehxHpe5JVJRBTgb9gevB1pHKMc=; b=Z66y3p3DU9d0nYYrWTatUYE4X99cEekF9TaenDMAD+oZpbA4wvrQ/eZ0cBsB9hyzqf CrpigjOtivFhO+2qvkx06LB/nZyISUWbDO0q5qhguHt0Mo4FpN7zS4hv5jLOUlGOS+ui 6No5U1KlfyzS3J+ybewLi0dtxxPH/KOVqpXno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; b=JB7XEHF5kDZe0M/2KKdLbqqb9yuhNSq59cW4D9G+7ZtcPirBYJfm+TKqPEJ1QqnJyC GKkvSBvDeOlfGPS6i7mWPIZRioEFp4ORVtVViFtc2QuYaR/So6P++hL/1C2ucO4erNip kYyZAJukgLCqz9u/VnoqhuL9f9/dPrF7xPt0A= Received: by 10.213.32.9 with SMTP id a9mr36142ebd.60.1291349251491; Thu, 02 Dec 2010 20:07:31 -0800 (PST) Received: from localhost ([139.91.73.37]) by mx.google.com with ESMTPS id y5sm1070136eeh.16.2010.12.02.20.07.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 02 Dec 2010 20:07:12 -0800 (PST) Date: Fri, 3 Dec 2010 06:07:13 +0200 From: Nick Kossifidis To: ath5k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, me@bobcopeland.com, mcgrof@gmail.com, jirislaby@gmail.com, nbd@openwrt.org, br1@einfach.org, sedat.dilek@googlemail.com Subject: [PATCH 3/6] ath5k: Disable ANI during reset Message-ID: <20101203040713.GC2988@makis.mantri> Mail-Followup-To: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org, linville@tuxdriver.com, me@bobcopeland.com, mcgrof@gmail.com, jirislaby@gmail.com, nbd@openwrt.org, br1@einfach.org, sedat.dilek@googlemail.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 04:07:37 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 047b2a0..6edfa9f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -2504,7 +2504,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, bool skip_pcu) { struct ath5k_hw *ah = sc->ah; - int ret; + int ret, ani_mode; ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); @@ -2512,6 +2512,12 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, synchronize_irq(sc->pdev->irq); stop_tasklets(sc); + /* Save ani mode and disable ANI durring + * reset. If we don't we might get false + * PHY error interrupts. */ + ani_mode = ah->ah_sc->ani_state.ani_mode; + ath5k_ani_init(ah, ATH5K_ANI_MODE_OFF); + /* We are going to empty hw queues * so we should also free any remaining * tx buffers */ @@ -2533,7 +2539,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, goto err; } - ath5k_ani_init(ah, ah->ah_sc->ani_state.ani_mode); + ath5k_ani_init(ah, ani_mode); ah->ah_cal_next_full = jiffies; ah->ah_cal_next_ani = jiffies;