diff mbox

[v2,4/5] ath9k: fix power consumption on network sleep when BTCOEX is enabled

Message ID 1341036529-10823-4-git-send-email-rmanohar@qca.qualcomm.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Manoharan, Rajkumar June 30, 2012, 6:08 a.m. UTC
The chip is waken up for every 45ms in btcoex timer cycle to
for sharing the radio between BT and WLAN. Whenever the wlan
interface is in network sleep mode, do not schedule hw timers.
This could reduce power consumption on idle associated state.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/gpio.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Manoharan, Rajkumar July 1, 2012, 2:22 p.m. UTC | #1
On Sat, Jun 30, 2012 at 11:38:48AM +0530, Rajkumar Manoharan wrote:
> The chip is waken up for every 45ms in btcoex timer cycle to
> for sharing the radio between BT and WLAN. Whenever the wlan
> interface is in network sleep mode, do not schedule hw timers.
> This could reduce power consumption on idle associated state.
> 
> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath9k/gpio.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
> index 9ae6a4d..c17168e 100644
> --- a/drivers/net/wireless/ath/ath9k/gpio.c
> +++ b/drivers/net/wireless/ath/ath9k/gpio.c
> @@ -194,6 +194,16 @@ static void ath_btcoex_period_timer(unsigned long data)
>  	struct ath_mci_profile *mci = &btcoex->mci;
>  	u32 timer_period;
>  	bool is_btscan;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&sc->sc_pm_lock, flags);
> +	if (sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP) {
> +		spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
> +		if (btcoex->hw_timer_enabled)
> +			ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);

Register access on sleep state should be avoided. Please drop this patchset.
Will send v3 series.

-Rajkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 9ae6a4d..c17168e 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -194,6 +194,16 @@  static void ath_btcoex_period_timer(unsigned long data)
 	struct ath_mci_profile *mci = &btcoex->mci;
 	u32 timer_period;
 	bool is_btscan;
+	unsigned long flags;
+
+	spin_lock_irqsave(&sc->sc_pm_lock, flags);
+	if (sc->sc_ah->power_mode == ATH9K_PM_NETWORK_SLEEP) {
+		spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
+		if (btcoex->hw_timer_enabled)
+			ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);
+		goto skip_hw_wakeup;
+	}
+	spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
 
 	ath9k_ps_wakeup(sc);
 	if (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
@@ -232,6 +242,7 @@  static void ath_btcoex_period_timer(unsigned long data)
 	}
 
 	ath9k_ps_restore(sc);
+skip_hw_wakeup:
 	timer_period = btcoex->btcoex_period;
 	mod_timer(&btcoex->period_timer, jiffies + msecs_to_jiffies(timer_period));
 }