All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.4] ath9k: wake up the hardware from full sleep when idle is turned off
@ 2012-04-12 18:36 Felix Fietkau
  2012-04-13  2:18 ` Sujith Manoharan
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2012-04-12 18:36 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, mcgrof

The hardware needs a reset to recover from full sleep. Issue this reset
directly in the ath9k_config call that turns off idle, otherwise tx
remains dead until the first channel change after the idle state change

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/main.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index ba5af8e..fcb13e3 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1584,6 +1584,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ieee80211_conf *conf = &hw->conf;
+	bool reset_channel = false;
 
 	ath9k_ps_wakeup(sc);
 	mutex_lock(&sc->mutex);
@@ -1592,6 +1593,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 		sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
 		if (sc->ps_idle)
 			ath_cancel_work(sc);
+		else
+			/*
+			 * The chip needs a reset to properly wake up from
+			 * full sleep
+			 */
+			reset_channel = ah->chip_fullsleep;
 	}
 
 	/*
@@ -1620,7 +1627,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
 		}
 	}
 
-	if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
+	if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
 		struct ieee80211_channel *curchan = hw->conf.channel;
 		int pos = curchan->hw_value;
 		int old_pos = -1;
-- 
1.7.3.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3.4] ath9k: wake up the hardware from full sleep when idle is turned off
  2012-04-12 18:36 [PATCH 3.4] ath9k: wake up the hardware from full sleep when idle is turned off Felix Fietkau
@ 2012-04-13  2:18 ` Sujith Manoharan
  2012-04-13  8:04   ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Sujith Manoharan @ 2012-04-13  2:18 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, linville, rodrigue

Felix Fietkau wrote:
> The hardware needs a reset to recover from full sleep. Issue this reset
> directly in the ath9k_config call that turns off idle, otherwise tx
> remains dead until the first channel change after the idle state change
> 
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
>  drivers/net/wireless/ath/ath9k/main.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index ba5af8e..fcb13e3 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -1584,6 +1584,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
>  	struct ath_hw *ah = sc->sc_ah;
>  	struct ath_common *common = ath9k_hw_common(ah);
>  	struct ieee80211_conf *conf = &hw->conf;
> +	bool reset_channel = false;
>  
>  	ath9k_ps_wakeup(sc);
>  	mutex_lock(&sc->mutex);
> @@ -1592,6 +1593,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
>  		sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
>  		if (sc->ps_idle)
>  			ath_cancel_work(sc);
> +		else
> +			/*
> +			 * The chip needs a reset to properly wake up from
> +			 * full sleep
> +			 */
> +			reset_channel = ah->chip_fullsleep;

This doesn't seem to work...

Since IDLE is broken currently, the HW never enters FULL_SLEEP mode and
reset_channel will always be zero, and a chip reset will be done only via
IEEE80211_CONF_CHANGE_CHANNEL.

Sujith

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3.4] ath9k: wake up the hardware from full sleep when idle is turned off
  2012-04-13  2:18 ` Sujith Manoharan
@ 2012-04-13  8:04   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2012-04-13  8:04 UTC (permalink / raw)
  To: Sujith Manoharan; +Cc: linux-wireless, linville, rodrigue

On 2012-04-13 4:18 AM, Sujith Manoharan wrote:
> Felix Fietkau wrote:
>> The hardware needs a reset to recover from full sleep. Issue this reset
>> directly in the ath9k_config call that turns off idle, otherwise tx
>> remains dead until the first channel change after the idle state change
>> 
>> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
>> ---
>>  drivers/net/wireless/ath/ath9k/main.c |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
>> index ba5af8e..fcb13e3 100644
>> --- a/drivers/net/wireless/ath/ath9k/main.c
>> +++ b/drivers/net/wireless/ath/ath9k/main.c
>> @@ -1584,6 +1584,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
>>  	struct ath_hw *ah = sc->sc_ah;
>>  	struct ath_common *common = ath9k_hw_common(ah);
>>  	struct ieee80211_conf *conf = &hw->conf;
>> +	bool reset_channel = false;
>>  
>>  	ath9k_ps_wakeup(sc);
>>  	mutex_lock(&sc->mutex);
>> @@ -1592,6 +1593,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
>>  		sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE);
>>  		if (sc->ps_idle)
>>  			ath_cancel_work(sc);
>> +		else
>> +			/*
>> +			 * The chip needs a reset to properly wake up from
>> +			 * full sleep
>> +			 */
>> +			reset_channel = ah->chip_fullsleep;
> 
> This doesn't seem to work...
> 
> Since IDLE is broken currently, the HW never enters FULL_SLEEP mode and
> reset_channel will always be zero, and a chip reset will be done only via
> IEEE80211_CONF_CHANGE_CHANNEL.
Consider this preparation for fixing idle mode.

- Felix

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-13  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 18:36 [PATCH 3.4] ath9k: wake up the hardware from full sleep when idle is turned off Felix Fietkau
2012-04-13  2:18 ` Sujith Manoharan
2012-04-13  8:04   ` Felix Fietkau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.