Search Linux Wireless

Re: Question about power save

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Larry,

> One of the users of an rtw8821ce found an increase of power usage from 272 mW in 
> kernel 5.19.13 to 579 mW in kernel 6.2.8. If he reverted commit 28977e790b5d 
> ("wifi: mac80211: skip powersave recalc if driver SUPPORTS_DYNAMIC_PS"), the 
> original power usage is restored.

Yeah, I think I saw the report, but I'm travelling and didn't have that
much time to reply.


> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -1787,7 +1787,8 @@ void ieee80211_recalc_ps(struct ieee80211_local *local)
>          int count = 0;
>          int timeout;
> 
> -       if (!ieee80211_hw_check(&local->hw, SUPPORTS_PS)) {
> +       if (!ieee80211_hw_check(&local->hw, SUPPORTS_PS) ||
> +           ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS)) {
>                  local->ps_sdata = NULL;
>                  return;
>          }
> 
> The driver in question has both SUPPORTS_PS and SUPPORTS_DYNAMIC_PS set, thus 
> this patch enables the dependent part of this test. Is this what was intended? 
> If so, then rtw88 is not supporting DYNAMIC_PS correctly.

I didn't really have time to analyze this ... In mac80211.h we say:

 * Dynamic powersave is simply supported by mac80211 enabling and disabling
 * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS
 * flag and mac80211 will handle everything automatically. Additionally,
 * hardware having support for the dynamic PS feature may set the
 * %IEEE80211_HW_SUPPORTS_DYNAMIC_PS flag to indicate that it can support
 * dynamic PS mode itself. The driver needs to look at the
 * @dynamic_ps_timeout hardware configuration value and use it that value
 * whenever %IEEE80211_CONF_PS is set. In this case mac80211 will disable
 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
 * enabled whenever user has enabled powersave.


but maybe the issue is that now CONF_PS isn't set any more?

johannes




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux