Commit df069780 authored by Loic Poulain's avatar Loic Poulain Committed by Kalle Valo

wcn36xx: Fix packet drop on resume

If the system is resumed because of an incoming packet, the wcn36xx RX
interrupts is fired before actual resuming of the wireless/mac80211
stack, causing any received packets to be simply dropped. E.g. a ping
request causes a system resume, but is dropped and so never forwarded
to the IP stack.

This change fixes that, disabling DMA interrupts on suspend to no pass
packets until mac80211 is resumed and ready to handle them.

Note that it's not incompatible with RX irq wake.
Signed-off-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Reviewed-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1635150496-19290-1-git-send-email-loic.poulain@linaro.org
parent 113f304d
...@@ -1124,6 +1124,13 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) ...@@ -1124,6 +1124,13 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow)
goto out; goto out;
ret = wcn36xx_smd_wlan_host_suspend_ind(wcn); ret = wcn36xx_smd_wlan_host_suspend_ind(wcn);
} }
/* Disable IRQ, we don't want to handle any packet before mac80211 is
* resumed and ready to receive packets.
*/
disable_irq(wcn->tx_irq);
disable_irq(wcn->rx_irq);
out: out:
mutex_unlock(&wcn->conf_mutex); mutex_unlock(&wcn->conf_mutex);
return ret; return ret;
...@@ -1146,6 +1153,10 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) ...@@ -1146,6 +1153,10 @@ static int wcn36xx_resume(struct ieee80211_hw *hw)
wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_ipv6_ns_offload(wcn, vif, false);
wcn36xx_smd_arp_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false);
} }
enable_irq(wcn->tx_irq);
enable_irq(wcn->rx_irq);
mutex_unlock(&wcn->conf_mutex); mutex_unlock(&wcn->conf_mutex);
return 0; return 0;
......
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