FAILED: patch "[PATCH] wifi: rtw88: correct PS calculation for SUPPORTS_DYNAMIC_PS" failed to apply to 6.1-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 3918dd0177ee08970683a2c22a3388825d82fd79
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023061100-swab-sultry-d7ef@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3918dd0177ee08970683a2c22a3388825d82fd79 Mon Sep 17 00:00:00 2001
From: Ping-Ke Shih <[email protected]>
Date: Sat, 27 May 2023 16:29:37 +0800
Subject: [PATCH] wifi: rtw88: correct PS calculation for SUPPORTS_DYNAMIC_PS
This driver relies on IEEE80211_CONF_PS of hw->conf.flags to turn off PS or
turn on dynamic PS controlled by driver and firmware. Though this would be incorrect, it did work before because the flag is always recalculated until
the commit 28977e790b5d ("wifi: mac80211: skip powersave recalc if driver SUPPORTS_DYNAMIC_PS") is introduced by kernel 5.20 to skip to recalculate IEEE80211_CONF_PS
of hw->conf.flags if driver sets SUPPORTS_DYNAMIC_PS.
Correct this by doing recalculation while BSS_CHANGED_PS is changed and interface is added or removed. It is allowed to enter PS only if single one station vif is working. Without this fix, driver doesn't enter PS anymore that causes higher power consumption.
drivers/net/wireless/realtek/rtw88/mac80211.c +5 -9
@@ -88,15 +88,6 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed) } } -if (changed &IEEE80211_CONF_CHANGE_PS ) { -if (hw->conf.flags &IEEE80211_CONF_PS ) { - rtwdev->ps_enabled = true; - }else { - rtwdev->ps_enabled = false; -rtw_leave_lps (rtwdev); - } - } -if (changed &IEEE80211_CONF_CHANGE_CHANNEL )rtw_set_channel (rtwdev);
@@ -213,6 +204,7 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw, config |=PORT_SET_BCN_CTRL ;rtw_vif_port_config (rtwdev, rtwvif, config);rtw_core_port_switch (rtwdev, vif); +rtw_recalc_lps (rtwdev, vif);mutex_unlock (&rtwdev->mutex);
@@ -244,6 +236,7 @@ static void rtw_ops_remove_interface(struct ieee80211_hw *hw, config |=PORT_SET_BCN_CTRL ;rtw_vif_port_config (rtwdev, rtwvif, config);clear_bit (rtwvif->port, rtwdev->hw_port); +rtw_recalc_lps (rtwdev,NULL );mutex_unlock (&rtwdev->mutex); }
@@ -438,6 +431,9 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,if (changed &BSS_CHANGED_ERP_SLOT )rtw_conf_tx (rtwdev, rtwvif); +if (changed &BSS_CHANGED_PS ) +rtw_recalc_lps (rtwdev,NULL ); +rtw_vif_port_config (rtwdev, rtwvif, config);mutex_unlock (&rtwdev->mutex);
drivers/net/wireless/realtek/rtw88/main.c +2 -2
@@ -271,8 +271,8 @@ static void rtw_watch_dog_work(struct work_struct *work)* more than two stations associated to the AP, then we can not enter * lps, because fw does not handle the overlapped beacon interval * -* mac80211 should iterate vifs and determine if driver can enter -* ps by passing IEEE80211_CONF_PS to us, all we need to do is to +* rtw_recalc_lps() iterate vifs and determine if driver can enter +* ps by vif->type and vif->cfg.ps, all we need to do here is to * get that vif and check if device is having traffic more than the * threshold. */
drivers/net/wireless/realtek/rtw88/ps.c +43 -0
46 lines not on this page · raw message
drivers/net/wireless/realtek/rtw88/ps.h +2 -0
@@ -23,4 +23,6 @@ void rtw_enter_lps(struct rtw_dev *rtwdev, u8 port_id);void rtw_leave_lps (struct rtw_dev *rtwdev);void rtw_leave_lps_deep (struct rtw_dev *rtwdev);enum rtw_lps_deep_mode rtw_get_lps_deep_mode (struct rtw_dev *rtwdev); +void rtw_recalc_lps (struct rtw_dev *rtwdev,struct ieee80211_vif *new_vif); +#endif
Ping-Ke Shih
maintainerPATCH 1/1 wifi: rtw88: correct PS calculation for SUPPORTS_DYNAMIC_PS
This driver relies on IEEE80211_CONF_PS of hw->conf.flags to turn off PS or
turn on dynamic PS controlled by driver and firmware. Though this would be incorrect, it did work before because the flag is always recalculated until
the commit 28977e790b5d ("wifi: mac80211: skip powersave recalc if driver SUPPORTS_DYNAMIC_PS") is introduced by kernel 5.20 to skip to recalculate IEEE80211_CONF_PS
of hw->conf.flags if driver sets SUPPORTS_DYNAMIC_PS.
Correct this by doing recalculation while BSS_CHANGED_PS is changed and interface is added or removed. It is allowed to enter PS only if single one station vif is working. Without this fix, driver doesn't enter PS anymore that causes higher power consumption.
--- drivers/net/wireless/realtek/rtw88/mac80211.c | 14 +++--- drivers/net/wireless/realtek/rtw88/main.c | 4 +- drivers/net/wireless/realtek/rtw88/ps.c | 43 +++++++++++++++++++ drivers/net/wireless/realtek/rtw88/ps.h | 2 + 4 files changed, 52 insertions(+), 11 deletions(-)
drivers/net/wireless/realtek/rtw88/mac80211.c +5 -9
@@ -88,15 +88,6 @@ static int rtw_ops_config(struct ieee80211_hw *hw, u32 changed) } } -if (changed &IEEE80211_CONF_CHANGE_PS ) { -if (hw->conf.flags &IEEE80211_CONF_PS ) { - rtwdev->ps_enabled = true; - }else { - rtwdev->ps_enabled = false; -rtw_leave_lps (rtwdev); - } - } -if (changed &IEEE80211_CONF_CHANGE_CHANNEL )rtw_set_channel (rtwdev);
@@ -206,6 +197,7 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw, rtwvif->bcn_ctrl = bcn_ctrl; config |=PORT_SET_BCN_CTRL ;rtw_vif_port_config (rtwdev, rtwvif, config); +rtw_recalc_lps (rtwdev, vif);mutex_unlock (&rtwdev->mutex);
@@ -236,6 +228,7 @@ static void rtw_ops_remove_interface(struct ieee80211_hw *hw, rtwvif->bcn_ctrl =0 ; config |=PORT_SET_BCN_CTRL ;rtw_vif_port_config (rtwdev, rtwvif, config); +rtw_recalc_lps (rtwdev,NULL );mutex_unlock (&rtwdev->mutex); }
@@ -428,6 +421,9 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,if (changed &BSS_CHANGED_ERP_SLOT )rtw_conf_tx (rtwdev, rtwvif); +if (changed &BSS_CHANGED_PS ) +rtw_recalc_lps (rtwdev,NULL ); +rtw_vif_port_config (rtwdev, rtwvif, config);mutex_unlock (&rtwdev->mutex);
drivers/net/wireless/realtek/rtw88/main.c +2 -2
@@ -248,8 +248,8 @@ static void rtw_watch_dog_work(struct work_struct *work)* more than two stations associated to the AP, then we can not enter * lps, because fw does not handle the overlapped beacon interval * -* mac80211 should iterate vifs and determine if driver can enter -* ps by passing IEEE80211_CONF_PS to us, all we need to do is to +* rtw_recalc_lps() iterate vifs and determine if driver can enter +* ps by vif->type and vif->cfg.ps, all we need to do here is to * get that vif and check if device is having traffic more than the * threshold. */
drivers/net/wireless/realtek/rtw88/ps.c +43 -0
46 lines not on this page · raw message
drivers/net/wireless/realtek/rtw88/ps.h +2 -0
@@ -23,4 +23,6 @@ void rtw_enter_lps(struct rtw_dev *rtwdev, u8 port_id);void rtw_leave_lps (struct rtw_dev *rtwdev);void rtw_leave_lps_deep (struct rtw_dev *rtwdev);enum rtw_lps_deep_mode rtw_get_lps_deep_mode (struct rtw_dev *rtwdev); +void rtw_recalc_lps (struct rtw_dev *rtwdev,struct ieee80211_vif *new_vif); +#endif
Signature · 1 line
2.25.1