rt2x00: check against flushing empty queue
authorStanislaw Gruszka <sgruszka@redhat.com>
Mon, 30 Apr 2018 13:19:17 +0000 (15:19 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 4 May 2018 12:34:20 +0000 (15:34 +0300)
commit811a3991510735566b66069fdd4ce3ce33a2ec18
tree1431ea28c03e0d6460ab19247f2a5f5c3deab492
parent9c87758cf0893d6d3b51aac34546807b138cb3e7
rt2x00: check against flushing empty queue

We have check if queue is not empty when start flushing queues on
by mac80211 callback, but we also can start flushing queues by internal
driver calls. So move check into rt2x00queue_flush_queue() to assure
we do not flush empty queue anytime.

Additionally add warning if we start to kick empty queue as in such
situation we set wrong index in the HW queue, what can confuse the HW
and have various negative consequences.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2800mmio.c
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
drivers/net/wireless/ralink/rt2x00/rt2x00queue.c