From patchwork Sun Jul 1 14:23:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manoharan, Rajkumar" X-Patchwork-Id: 1144241 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 2F6E3DFB7C for ; Sun, 1 Jul 2012 14:23:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105Ab2GAOW7 (ORCPT ); Sun, 1 Jul 2012 10:22:59 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:59844 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755752Ab2GAOW6 (ORCPT ); Sun, 1 Jul 2012 10:22:58 -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=1341152579; x=1372688579; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=FtQ2IuFWyLu3s2MT5lQllkfHzc+ew9QJb0q4JsLLC8k=; b=bSLNPyrQeqTHOA483RZYDPKzxcYOIu8wnnVnfRk9b5ko3ev0aLSqN7hn pvXXzaL8tnbUzPJY3+KSKMB+6T5bN+DGHiFJBYjWRvxr3Cj1nlfriIIff lCzF7vIMtOzhDnhwP9nBOSal/OqBEWn4Q7hz5ksBl8SxtudmZym8ZqnbM g=; X-IronPort-AV: E=McAfee;i="5400,1158,6758"; a="204098128" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine02.qualcomm.com with ESMTP; 01 Jul 2012 07:22:59 -0700 X-IronPort-AV: E=Sophos;i="4.77,504,1336374000"; d="scan'208";a="338019525" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 01 Jul 2012 07:22:59 -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; Sun, 1 Jul 2012 07:22:56 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Sun, 01 Jul 2012 19:54:20 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v3 3/5] ath9k: fix fullsleep power consumption when BTCOEX is enabled Date: Sun, 1 Jul 2012 19:53:53 +0530 Message-ID: <1341152635-4840-3-git-send-email-rmanohar@qca.qualcomm.com> X-Mailer: git-send-email 1.7.11.1 In-Reply-To: <1341152635-4840-1-git-send-email-rmanohar@qca.qualcomm.com> References: <1341152635-4840-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; + } } /*