From patchwork Tue Sep 6 15:30:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manoharan, Rajkumar" X-Patchwork-Id: 1126622 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 p86FTmed019960 for ; Tue, 6 Sep 2011 15:29:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755013Ab1IFP3m (ORCPT ); Tue, 6 Sep 2011 11:29:42 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:27736 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755011Ab1IFP3m (ORCPT ); Tue, 6 Sep 2011 11:29: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=1315322982; x=1346858982; 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=20v2=202/2]=20ath9k: =20Move=20cycle=20conters=20under=20cc_lock|Date:=20Tue, =206=20Sep=202011=2021:00:07=20+0530|Message-ID:=20<13153 23007-1853-2-git-send-email-rmanohar@qca.qualcomm.com> |In-Reply-To:=20<1315323007-1853-1-git-send-email-rmanoha r@qca.qualcomm.com>|References:=20<1315323007-1853-1-git- send-email-rmanohar@qca.qualcomm.com>|MIME-Version:=201.0; bh=JCZSobDeno8toN5VHGdEVkoPQJFIqBgW3TpNa0hpoVw=; b=Go7j27HfAZWupg2hCy0DevOTEyd1M/UgDLRSyTM4uHaAX852PetGRh3i 26JoKE9yG4JWB37jo6nzJWC4wCqYQ2DlkkdcYaKtdOFuXpAULlwjVq+JK Qn4vv40Psl+kUA6oSOOzLKYW+M8DZzH+hUVsySpBWb8axFOAtQPOvXWSe g=; X-IronPort-AV: E=McAfee;i="5400,1158,6460"; a="115839229" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by wolverine01.qualcomm.com with ESMTP; 06 Sep 2011 08:29:41 -0700 X-IronPort-AV: E=Sophos;i="4.68,338,1312182000"; d="scan'208";a="69810935" Received: from nasanexhub05.na.qualcomm.com ([129.46.134.219]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-MD5; 06 Sep 2011 08:29:41 -0700 Received: from NASJOEXHC01.na.qualcomm.com (10.234.56.15) by nasanexhub05.na.qualcomm.com (129.46.134.219) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 6 Sep 2011 08:29:41 -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 08:29:39 -0700 Received: by qcamail1.atheros.com (sSMTP sendmail emulation); Tue, 06 Sep 2011 21:00:14 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 2/2] ath9k: Move cycle conters under cc_lock Date: Tue, 6 Sep 2011 21:00:07 +0530 Message-ID: <1315323007-1853-2-git-send-email-rmanohar@qca.qualcomm.com> X-Mailer: git-send-email 1.7.6.1 In-Reply-To: <1315323007-1853-1-git-send-email-rmanohar@qca.qualcomm.com> References: <1315323007-1853-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 15:29:48 +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 bafb7b7..5cc6a2c 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, @@ -1390,6 +1391,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,