From patchwork Tue Sep 6 14:51:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manoharan, Rajkumar" X-Patchwork-Id: 1126562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p86Eoj4c013616 for ; Tue, 6 Sep 2011 14:50:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322Ab1IFOun (ORCPT ); Tue, 6 Sep 2011 10:50:43 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:24276 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754239Ab1IFOum (ORCPT ); Tue, 6 Sep 2011 10:50:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=rmanohar@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1315320642; x=1346856642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; z=From:=20Rajkumar=20Manoharan=20|To:=20|CC:=20,=20Rajkumar=20Manoharan=0D=0A=09|Subject:=20[PATCH=202/2]=20ath9k:=20Mo ve=20cycle=20conters=20under=20cc_lock|Date:=20Tue,=206 =20Sep=202011=2020:21:08=20+0530|Message-ID:=20<131532066 8-2882-2-git-send-email-rmanohar@qca.qualcomm.com> |In-Reply-To:=20<1315320668-2882-1-git-send-email-rmanoha r@qca.qualcomm.com>|References:=20<1315320668-2882-1-git- send-email-rmanohar@qca.qualcomm.com>|MIME-Version:=201.0; bh=HhFZSuhjHXevKzgtS2xpwWoBSSn2qhL3LXsQrdGuajA=; b=UGITHxHBU1T8d5aOtzyDWewJOCzwJPopO9vWCvjmTD9j7r+dpGtnOXEx iVAIO9xmkvaGi7yRURmokmGLbrg0XCxY210XJoHRgcNCAj3eJ62vJ2DPl Mw8j2ObxqNawC+lW1TOAL/rqm8Ur5MrmVkUMu/mFwwNZrKA7ix8t416VN I=; X-IronPort-AV: E=McAfee;i="5400,1158,6460"; a="115637914" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by wolverine02.qualcomm.com with ESMTP; 06 Sep 2011 07:50:42 -0700 X-IronPort-AV: E=Sophos;i="4.68,338,1312182000"; d="scan'208";a="69805042" Received: from nasanexhub06.na.qualcomm.com ([129.46.134.254]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-MD5; 06 Sep 2011 07:50:42 -0700 Received: from NASJOEXHC01.na.qualcomm.com (10.234.56.15) by nasanexhub06.na.qualcomm.com (129.46.134.254) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 6 Sep 2011 07:50:42 -0700 Received: from qcamail1.atheros.com (10.12.7.11) by qcamail1.atheros.com (10.234.56.15) with Microsoft SMTP Server (TLS) id 14.1.323.3; Tue, 6 Sep 2011 07:50:40 -0700 Received: by qcamail1.atheros.com (sSMTP sendmail emulation); Tue, 06 Sep 2011 20:21:15 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 2/2] ath9k: Move cycle conters under cc_lock Date: Tue, 6 Sep 2011 20:21:08 +0530 Message-ID: <1315320668-2882-2-git-send-email-rmanohar@qca.qualcomm.com> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1315320668-2882-1-git-send-email-rmanohar@qca.qualcomm.com> References: <1315320668-2882-1-git-send-email-rmanohar@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.12.7.11] 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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 06 Sep 2011 14:50:45 +0000 (UTC) This patch protects cycle counters access by cc_lock and also prints current sample index. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath9k/debug.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 3d377ee..ee8640d 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1323,16 +1323,17 @@ void ath9k_debug_samp_bb_mac(struct ath_softc *sc) ath9k_ps_wakeup(sc); + spin_lock_bh(&sc->debug.samp_lock); + spin_lock_irqsave(&common->cc_lock, flags); ath_hw_cycle_counters_update(common); - spin_unlock_irqrestore(&common->cc_lock, flags); - - spin_lock_bh(&sc->debug.samp_lock); ATH_SAMP_DBG(cc.cycles) = common->cc_ani.cycles; ATH_SAMP_DBG(cc.rx_busy) = common->cc_ani.rx_busy; ATH_SAMP_DBG(cc.rx_frame) = common->cc_ani.rx_frame; ATH_SAMP_DBG(cc.tx_frame) = common->cc_ani.tx_frame; + spin_unlock_irqrestore(&common->cc_lock, flags); + ATH_SAMP_DBG(noise) = ah->noise; REG_WRITE_D(ah, AR_MACMISC, @@ -1387,6 +1388,8 @@ static int open_file_bb_mac_samps(struct inode *inode, struct file *file) spin_lock_bh(&sc->debug.samp_lock); memcpy(bb_mac_samp, sc->debug.bb_mac_samp, sizeof(*bb_mac_samp) * ATH_DBG_MAX_SAMPLES); + len += snprintf(buf + len, size - len, + "Current Sample Index: %d\n", sc->debug.sampidx); spin_unlock_bh(&sc->debug.samp_lock); len += snprintf(buf + len, size - len,