diff mbox series

[2/2] mwifiex: do not download TX packets if interface has not resumed

Message ID 1573622132-16181-2-git-send-email-gbhat@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series [1/2] mwifiex: fix requesting zero memory for firmware dump | expand

Commit Message

Ganapathi Bhat Nov. 13, 2019, 5:15 a.m. UTC
From: Sharvari Harisangam <sharvari@marvell.com>

mwifiex_queue_tx_pkt would queue the TX packet to driver queues
and before return, would invoke main_work, which in turn would
download the packet to firmware. In case the card is in sleep
state, driver would wakeup the card(via interface).

During resume it is possible that, the applications send packets
even before interface has completed its resume. If driver try to
access interface register(to wakeup the card), it would lead to
invalid results.

To avoid this, don't invoke main_work, when hs_activated is set.

Signed-off-by: Sharvari Harisangam <sharvari@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index a9657ae..7b5cf2c0 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -808,6 +808,11 @@  int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb)
 		mwifiex_wmm_add_buf_txqueue(priv, skb);
 	 }
 
+	if (priv->adapter->hs_activated) {
+		mwifiex_dbg(priv->adapter, ERROR, "hs_activated: queue TX\n");
+		return 0;
+	}
+
 	mwifiex_queue_main_work(priv->adapter);
 
 	return 0;