From patchwork Sat Jun 30 06:08:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manoharan, Rajkumar" X-Patchwork-Id: 1134061 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 773D640AC1 for ; Sat, 30 Jun 2012 06:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400Ab2F3GHl (ORCPT ); Sat, 30 Jun 2012 02:07:41 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:27307 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204Ab2F3GHl (ORCPT ); Sat, 30 Jun 2012 02:07:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1341036460; x=1372572460; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=2q/flrYCz+s05tO7JGTEEkMFnOixhT6sqEV4y+s5Tng=; b=KyWn/D7uS15Eyi3OuzRm8YZ+nOB0lS4uzUB23OEcPdbyxoMJV6jwhCS3 Lxxgn8BTZtt8mrD4OPIrs2xFrAcMT7ECqzQzXBJXL07ins8HNQD5ECD8h oxh/IAj8cXXmxxr9JrqIT9J+IzBusmx2/Al+qu+DZqckcDPwl60YrPa1I 4=; X-IronPort-AV: E=McAfee;i="5400,1158,6757"; a="206251408" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by wolverine01.qualcomm.com with ESMTP; 29 Jun 2012 23:07:40 -0700 X-IronPort-AV: E=Sophos;i="4.77,501,1336374000"; d="scan'208";a="250752221" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 29 Jun 2012 23:07:40 -0700 Received: from qcmail1.qualcomm.com (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.2.283.3; Fri, 29 Jun 2012 23:07:39 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Sat, 30 Jun 2012 11:39:01 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 2/5] ath9k_hw: do not load noise floor readings when it is running Date: Sat, 30 Jun 2012 11:38:46 +0530 Message-ID: <1341036529-10823-2-git-send-email-rmanohar@qca.qualcomm.com> X-Mailer: git-send-email 1.7.11.1 In-Reply-To: <1341036529-10823-1-git-send-email-rmanohar@qca.qualcomm.com> References: <1341036529-10823-1-git-send-email-rmanohar@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Noise floor calibration is performed on longcal interval and the reading will be updated in history buffer. On rare occasions, the previous noisefloor calibration might not be completed within the period and trying to load nf reading will be failed. In such situation, postpone the nf cabliration to next cycle to give enough time to complete the calibration. This was already taken care for ar9002 chips. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath9k/ar9003_calib.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c index d7deb8c..84b558d 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c @@ -159,14 +159,11 @@ static bool ar9003_hw_calibrate(struct ath_hw *ah, } } - /* Do NF cal only at longer intervals */ - if (longcal) { - /* - * Get the value from the previous NF cal and update - * history buffer. - */ - ath9k_hw_getnf(ah, chan); - + /* + * Do NF cal only at longer intervals. Get the value from + * the previous NF cal and update history buffer. + */ + if (longcal && ath9k_hw_getnf(ah, chan)) { /* * Load the NF from history buffer of the current channel. * NF is slow time-variant, so it is OK to use a historical