From patchwork Fri Jun 29 06:40:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manoharan, Rajkumar" X-Patchwork-Id: 1130731 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BA8CBDFF34 for ; Fri, 29 Jun 2012 06:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751641Ab2F2GjN (ORCPT ); Fri, 29 Jun 2012 02:39:13 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:29270 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210Ab2F2GjM (ORCPT ); Fri, 29 Jun 2012 02:39:12 -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=1340951952; x=1372487952; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=FtQ2IuFWyLu3s2MT5lQllkfHzc+ew9QJb0q4JsLLC8k=; b=Y19PhJIQ54XpLxWfArTpohrN+0S32qgpaP9EbvhX7qnEfAc4tb8poABw JdG60IkEBtJ3S7fkjBu7U3DolSMnZaonU7d19ZOV/UQvNNZO2UtnjUfqt pqeqouetIdM51eP7qIVubMMf4TifESJtc4nKOpxv7cfoyh1O5BhtXEh09 4=; X-IronPort-AV: E=McAfee;i="5400,1158,6756"; a="205857461" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine01.qualcomm.com with ESMTP; 28 Jun 2012 23:39:11 -0700 X-IronPort-AV: E=Sophos;i="4.77,496,1336374000"; d="scan'208";a="336780434" Received: from nasanexhc04.na.qualcomm.com ([172.30.48.17]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 28 Jun 2012 23:39:11 -0700 Received: from qcmail1.qualcomm.com (172.30.48.1) by qcmail1.qualcomm.com (172.30.48.17) with Microsoft SMTP Server (TLS) id 14.2.283.3; Thu, 28 Jun 2012 23:39:09 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 29 Jun 2012 12:10:31 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 3/5] ath9k: fix fullsleep power consumption when BTCOEX is enabled Date: Fri, 29 Jun 2012 12:10:07 +0530 Message-ID: <1340952009-12223-3-git-send-email-rmanohar@qca.qualcomm.com> X-Mailer: git-send-email 1.7.11.1 In-Reply-To: <1340952009-12223-1-git-send-email-rmanohar@qca.qualcomm.com> References: <1340952009-12223-1-git-send-email-rmanohar@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [172.30.48.1] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org As soon as the interface brought up, btcoex timer starts running eventhough the interface is in idle state and WLAN chip is moved to full sleep mode. There is no point in running btcoex timer when the wlan interface is in sleep mode and also it might consumes more power on WLAN idle unassociated state. So lets stop the btcoex when wlan is idle state. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath9k/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index e4e73f0..6ce0128 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -666,8 +666,6 @@ static int ath9k_start(struct ieee80211_hw *hw) spin_unlock_bh(&sc->sc_pcu_lock); - ath9k_start_btcoex(sc); - if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en) common->bus_ops->extn_synch_en(common); @@ -774,8 +772,6 @@ static void ath9k_stop(struct ieee80211_hw *hw) /* Ensure HW is awake when we try to shut it down. */ ath9k_ps_wakeup(sc); - ath9k_stop_btcoex(sc); - spin_lock_bh(&sc->sc_pcu_lock); /* prevent tasklets to enable interrupts once we disable them */ @@ -1139,14 +1135,17 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) if (changed & IEEE80211_CONF_CHANGE_IDLE) { sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); - if (sc->ps_idle) + if (sc->ps_idle) { ath_cancel_work(sc); - else + ath9k_stop_btcoex(sc); + } else { + ath9k_start_btcoex(sc); /* * The chip needs a reset to properly wake up from * full sleep */ reset_channel = ah->chip_fullsleep; + } } /*