Commit 432a127f authored by Sanjay Kumar Konduri's avatar Sanjay Kumar Konduri Committed by Kleber Sacilotto de Souza

UBUNTU: SAUCE: Redpine: resolve power save issue after S4 resume

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1753438
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1753439

We are redownloading the firmware after S4 resume. We 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.
Signed-off-by: default avatarSanjay Kumar Konduri <sanjay.konduri@redpinesignals.com>
Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent a01f58ca
...@@ -359,6 +359,7 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw, ...@@ -359,6 +359,7 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
int ii =0; int ii =0;
ven_rsi_dbg(INFO_ZONE, "***** Hardware scan start *****\n"); ven_rsi_dbg(INFO_ZONE, "***** Hardware scan start *****\n");
common->mac_ops_resumed = false;
if (common->fsm_state != FSM_MAC_INIT_DONE) if (common->fsm_state != FSM_MAC_INIT_DONE)
return -ENODEV; return -ENODEV;
...@@ -566,6 +567,8 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw, ...@@ -566,6 +567,8 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw,
(adapter->ps_state == PS_ENABLED) && (adapter->ps_state == PS_ENABLED) &&
(vif->type == NL80211_IFTYPE_STATION)) (vif->type == NL80211_IFTYPE_STATION))
rsi_disable_ps(adapter); rsi_disable_ps(adapter);
if (ieee80211_is_auth(wlh->frame_control))
common->mac_ops_resumed = false;
if ((common->coex_mode == 4) && if ((common->coex_mode == 4) &&
(vif->type == NL80211_IFTYPE_STATION) && (vif->type == NL80211_IFTYPE_STATION) &&
...@@ -1078,7 +1081,8 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw, ...@@ -1078,7 +1081,8 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
/* Power save parameters */ /* Power save parameters */
if ((changed & IEEE80211_CONF_CHANGE_PS) && if ((changed & IEEE80211_CONF_CHANGE_PS) &&
(vif->type == NL80211_IFTYPE_STATION)) { (vif->type == NL80211_IFTYPE_STATION) &&
!common->mac_ops_resumed) {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&adapter->ps_lock, flags); spin_lock_irqsave(&adapter->ps_lock, flags);
...@@ -2466,6 +2470,7 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw) ...@@ -2466,6 +2470,7 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw)
ven_rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__); ven_rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__);
if (common->hibernate_resume) { if (common->hibernate_resume) {
common->mac_ops_resumed = true;
if (common->reinit_hw) if (common->reinit_hw)
wait_for_completion(&common->wlan_init_completion); wait_for_completion(&common->wlan_init_completion);
/* Device need a complete restart of all MAC operations. /* Device need a complete restart of all MAC operations.
......
...@@ -1506,6 +1506,7 @@ int rsi_restore(struct device *dev) ...@@ -1506,6 +1506,7 @@ int rsi_restore(struct device *dev)
adapter->priv->iface_down = true; adapter->priv->iface_down = true;
adapter->sc_nvifs = 0; adapter->sc_nvifs = 0;
adapter->ps_state = PS_NONE;
flush_workqueue(adapter->priv->scan_workqueue); flush_workqueue(adapter->priv->scan_workqueue);
ieee80211_stop_queues(adapter->hw); ieee80211_stop_queues(adapter->hw);
......
...@@ -381,6 +381,7 @@ struct rsi_common { ...@@ -381,6 +381,7 @@ struct rsi_common {
struct timer_list scan_timer; struct timer_list scan_timer;
bool hw_scan_cancel; bool hw_scan_cancel;
#endif #endif
bool mac_ops_resumed;
}; };
enum host_intf { enum host_intf {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment