2011-09-21 16:37:43

by Johannes Berg

[permalink] [raw]
Subject: client powersave is completely broken on ath9k and similar HW

iwconfig wlan0 power timeout 0
iwconfig wlan0 power off
iwconfig wlan0 power on

=> observe that power saving stays disabled forever

Last little bit of http://paste.pocoo.org/raw/479987/ seems to make it
work somewhat, but is then still completely broken when timeout is >0
due to the abuse of the dynps timer/work to process tx status:

Clearly this is completely messed up. Somebody is going to need to pay
back all the technical debt accumulated here and rewrite it all.

johannes



2011-09-21 17:01:38

by Kalle Valo

[permalink] [raw]
Subject: Re: client powersave is completely broken on ath9k and similar HW

On 09/21/2011 07:37 PM, Johannes Berg wrote:
> iwconfig wlan0 power timeout 0
> iwconfig wlan0 power off
> iwconfig wlan0 power on
>
> => observe that power saving stays disabled forever
>
> Last little bit of http://paste.pocoo.org/raw/479987/ seems to make it
> work somewhat, but is then still completely broken when timeout is >0
> due to the abuse of the dynps timer/work to process tx status:
>
> Clearly this is completely messed up. Somebody is going to need to pay
> back all the technical debt accumulated here and rewrite it all.

I think we should just remove the client PS support from mac8011 and
drivers instead should implement power save on their own. The current
setup simply don't work.

My reasoning:

1) all power save implementations in hardware are a bit different, which
makes mac80211 implementation complex (how many different designs do we
support now, three or four?)

2) Driver authors care only about their driver and the bugs they are
trying to fix with zero interest how it might affect other drivers. They
dump something to mac80211 and then the change is forgotten.

3) Power save bugs are difficult to notice, test and debug. So
regressions are easily missed.

4) If the power save support is implemented in the driver, they can't
break other drivers and are free to do whatever optimisations/fixes they
want.

I'm happy to create a patch to remove client PS code from mac80211 if we
so decide.

Kalle

2011-09-21 19:55:42

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: client powersave is completely broken on ath9k and similar HW

On Wed, Sep 21, 2011 at 10:01 AM, Kalle Valo <[email protected]> wrote:
> On 09/21/2011 07:37 PM, Johannes Berg wrote:
>> iwconfig wlan0 power timeout 0
>> iwconfig wlan0 power off
>> iwconfig wlan0 power on
>>
>> => observe that power saving stays disabled forever
>>
>> Last little bit of http://paste.pocoo.org/raw/479987/ seems to make it
>> work somewhat, but is then still completely broken when timeout is >0
>> due to the abuse of the dynps timer/work to process tx status:
>>
>> Clearly this is completely messed up. Somebody is going to need to pay
>> back all the technical debt accumulated here and rewrite it all.
>
> I think we should just remove the client PS support from mac8011 and
> drivers instead should implement power save on their own. The current
> setup simply don't work.
>
> My reasoning:
>
> 1) all power save implementations in hardware are a bit different, which
> makes mac80211 implementation complex (how many different designs do we
> support now, three or four?)
>
> 2) Driver authors care only about their driver and the bugs they are
> trying to fix with zero interest how it might affect other drivers. They
> dump something to mac80211 and then the change is forgotten.
>
> 3) Power save bugs are difficult to notice, test and debug. So
> regressions are easily missed.
>
> 4) If the power save support is implemented in the driver, they can't
> break other drivers and are free to do whatever optimisations/fixes they
> want.
>
> I'm happy to create a patch to remove client PS code from mac80211 if we
> so decide.

Removal of code from mac80211 is not sufficient, an equivalent
replacement for each driver that does use this code is already
required.

Luis