Commit 18aa755b authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wl12xx: flush all Tx queues on tx_flush timeout

Ensure our queues are empty at the end of a tx_flush(), in case we
timeout on passively waiting for them. This makes sure no left-overs are
transmitted when we are on the wrong channel.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 49c9cd26
...@@ -1040,6 +1040,7 @@ void wl12xx_tx_reset(struct wl1271 *wl, bool reset_tx_queues) ...@@ -1040,6 +1040,7 @@ void wl12xx_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
void wl1271_tx_flush(struct wl1271 *wl) void wl1271_tx_flush(struct wl1271 *wl)
{ {
unsigned long timeout; unsigned long timeout;
int i;
timeout = jiffies + usecs_to_jiffies(WL1271_TX_FLUSH_TIMEOUT); timeout = jiffies + usecs_to_jiffies(WL1271_TX_FLUSH_TIMEOUT);
while (!time_after(jiffies, timeout)) { while (!time_after(jiffies, timeout)) {
...@@ -1057,6 +1058,12 @@ void wl1271_tx_flush(struct wl1271 *wl) ...@@ -1057,6 +1058,12 @@ void wl1271_tx_flush(struct wl1271 *wl)
} }
wl1271_warning("Unable to flush all TX buffers, timed out."); wl1271_warning("Unable to flush all TX buffers, timed out.");
/* forcibly flush all Tx buffers on our queues */
mutex_lock(&wl->mutex);
for (i = 0; i < WL12XX_MAX_LINKS; i++)
wl1271_tx_reset_link_queues(wl, i);
mutex_unlock(&wl->mutex);
} }
u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set) u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set)
......
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