summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-04-01 13:04:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 08:55:37 +0200
commit7f573a6fb1d848121a8793756a0d3a7949ee621d (patch)
tree1d2612952579523e0afe2991ace1ad73aa000763 /drivers
parent4c6b3837c6dc0d9e5f9ec910da2e36349beea733 (diff)
downloadlinux-7f573a6fb1d848121a8793756a0d3a7949ee621d.tar.bz2
staging: wfx: wfx_flush() did not ensure that frames are processed
wfx_flush() exited once all frames are retrieved from the device. However, it did not ensure they were processed by driver before to return. Therefore, some frame may be processed after the interface has disappear. Change the place we signal that the queue is empty to fix that. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200401110405.80282-30-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wfx/bh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index 9fcab00a3733..ba7fa0a7cd9a 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -108,8 +108,6 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
release_count = 1;
WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter");
wdev->hif.tx_buffers_used -= release_count;
- if (!wdev->hif.tx_buffers_used)
- wake_up(&wdev->hif.tx_buffers_empty);
}
_trace_hif_recv(hif, wdev->hif.tx_buffers_used);
@@ -123,6 +121,8 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
skb_put(skb, hif->len);
// wfx_handle_rx takes care on SKB livetime
wfx_handle_rx(wdev, skb);
+ if (!wdev->hif.tx_buffers_used)
+ wake_up(&wdev->hif.tx_buffers_empty);
return piggyback;