From patchwork Sat Jun 30 06:08:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manoharan, Rajkumar" X-Patchwork-Id: 1134071 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 BCC83DFFEA for ; Sat, 30 Jun 2012 06:07:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492Ab2F3GHu (ORCPT ); Sat, 30 Jun 2012 02:07:50 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:61764 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204Ab2F3GHt (ORCPT ); Sat, 30 Jun 2012 02:07:49 -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=1341036469; x=1372572469; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=FtQ2IuFWyLu3s2MT5lQllkfHzc+ew9QJb0q4JsLLC8k=; b=ZKjlEaoMootaIgiXTm3+LW3MIl4bjHxfke1jMo9Q3TSKuT3bWPHwBf4r Lf13uDtuFqrltHThr2/4jN49CO3tv6K1Jm0hFXvXPzjYIFOGNGNrWjyeX 2vx9/Lf4W8g3i3/vtJHRRKJAlk/lX2QVO4c4q4m4BWvLIX37HnHz2I7pK A=; X-IronPort-AV: E=McAfee;i="5400,1158,6757"; a="203875516" Received: from ironmsg02-r.qualcomm.com ([172.30.46.16]) by wolverine02.qualcomm.com with ESMTP; 29 Jun 2012 23:07:49 -0700 X-IronPort-AV: E=Sophos;i="4.77,501,1336374000"; d="scan'208";a="159877339" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 29 Jun 2012 23:07:49 -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:48 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Sat, 30 Jun 2012 11:39:10 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 3/5] ath9k: fix fullsleep power consumption when BTCOEX is enabled Date: Sat, 30 Jun 2012 11:38:47 +0530 Message-ID: <1341036529-10823-3-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 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; + } } /*