rsi: resolve power save issue after S4 resume
authorSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Mon, 4 Feb 2019 06:33:28 +0000 (12:03 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 8 Feb 2019 15:29:40 +0000 (17:29 +0200)
We are redownloading the firmware after S4 restore and observed in
stress test that mac80211 sometimes gives power save request after
resume which causes the firmware in bad state. mac_ops_resumed flag
is added to skip that request until initialisation is done and Keeping
power save state is NONE.

Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_mac80211.c
drivers/net/wireless/rsi/rsi_91x_sdio.c
drivers/net/wireless/rsi/rsi_main.h

index 8d1282f524cf1bedcf9ebccb0d209ba8150cfb22..7bc8da69bfedb705c40bc195a2244fad1505d18d 100644 (file)
@@ -239,6 +239,7 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
        struct ieee80211_bss_conf *bss = &vif->bss_conf;
 
        rsi_dbg(INFO_ZONE, "***** Hardware scan start *****\n");
+       common->mac_ops_resumed = false;
 
        if (common->fsm_state != FSM_MAC_INIT_DONE)
                return -ENODEV;
@@ -370,6 +371,10 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw,
 {
        struct rsi_hw *adapter = hw->priv;
        struct rsi_common *common = adapter->priv;
+       struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data;
+
+       if (ieee80211_is_auth(wlh->frame_control))
+               common->mac_ops_resumed = false;
 
        rsi_core_xmit(common, skb);
 }
@@ -677,7 +682,8 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
        }
 
        /* Power save parameters */
-       if (changed & IEEE80211_CONF_CHANGE_PS) {
+       if ((changed & IEEE80211_CONF_CHANGE_PS) &&
+           !common->mac_ops_resumed) {
                struct ieee80211_vif *vif, *sta_vif = NULL;
                unsigned long flags;
                int i, set_ps = 1;
@@ -1939,6 +1945,7 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw)
        rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__);
 
        if (common->hibernate_resume) {
+               common->mac_ops_resumed = true;
                /* Device need a complete restart of all MAC operations.
                 * returning 1 will serve this purpose.
                 */
index 449803cca73f077e348989a9d3d6a6f5e4ab0689..764ad06cf9106bb8c10ece2610a0d382e6532de0 100644 (file)
@@ -1396,6 +1396,7 @@ static int rsi_restore(struct device *dev)
        common->iface_down = true;
 
        adapter->sc_nvifs = 0;
+       adapter->ps_state = PS_NONE;
 
        common->wow_flags = 0;
        common->iface_down = false;
index 4dc0c012346956dda3a5d6ed5f09b3f013e9e1c5..35d13f35e9b002261f5dd00502b742cd539a579b 100644 (file)
@@ -311,6 +311,7 @@ struct rsi_common {
        struct cfg80211_scan_request *hwscan;
        struct rsi_bgscan_params bgscan;
        u8 bgscan_en;
+       u8 mac_ops_resumed;
 };
 
 struct eepromrw_info {