]> git.baikalelectronics.ru Git - kernel.git/commit
rt2x00usb: fix rx queue hang
authorSoeren Moch <smoch@web.de>
Mon, 1 Jul 2019 10:53:13 +0000 (12:53 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 15 Jul 2019 17:52:18 +0000 (20:52 +0300)
commitf6db8654fc308a837d3eba68d136be5e85157318
treef5fa6b68c5109ee63622392295e525772206d73f
parentec5e53ea484583881da819c740033672b27035ec
rt2x00usb: fix rx queue hang

Since commit 7eb78a1df8ed ("usb: core: remove local_irq_save() around
 ->complete() handler") the handler rt2x00usb_interrupt_rxdone() is
not running with interrupts disabled anymore. So this completion handler
is not guaranteed to run completely before workqueue processing starts
for the same queue entry.
Be sure to set all other flags in the entry correctly before marking
this entry ready for workqueue processing. This way we cannot miss error
conditions that need to be signalled from the completion handler to the
worker thread.
Note that rt2x00usb_work_rxdone() processes all available entries, not
only such for which queue_work() was called.

This patch is similar to what commit cdc7cb7fc36d ("rt2x00: fix order
of entry flags modification") did for TX processing.

This fixes a regression on a RT5370 based wifi stick in AP mode, which
suddenly stopped data transmission after some period of heavy load. Also
stopping the hanging hostapd resulted in the error message "ieee80211
phy0: rt2x00queue_flush_queue: Warning - Queue 14 failed to flush".
Other operation modes are probably affected as well, this just was
the used testcase.

Fixes: 7eb78a1df8ed ("usb: core: remove local_irq_save() around ->complete() handler")
Cc: stable@vger.kernel.org # 4.20+
Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c