rt2x00usb: mark device removed when get ENOENT usb error
authorStanislaw Gruszka <sgruszka@redhat.com>
Thu, 9 Nov 2017 10:59:24 +0000 (11:59 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:15 +0000 (18:32 +0000)
commitd649dac2baff246209ddcf55d51832b8b98e2cb3
tree41b460ce4a8a62acc9bdecd8acf639e4995b503f
parent6b3fa3dd62ccad96f1a2523c50d678a20049a41a
rt2x00usb: mark device removed when get ENOENT usb error

commit bfa62a52cad93686bb8d8171ea5288813248a7c6 upstream.

ENOENT usb error mean "specified interface or endpoint does not exist or
is not enabled". Mark device not present when we encounter this error
similar like we do with ENODEV error.

Otherwise we can have infinite loop in rt2x00usb_work_rxdone(), because
we remove and put again RX entries to the queue infinitely.

We can have similar situation when submit urb will fail all the time
with other error, so we need consider to limit number of entries
processed by rxdone work. But for now, since the patch fixes
reproducible soft lockup issue on single processor systems
and taken ENOENT error meaning, let apply this fix.

Patch adds additional ENOENT check not only in rx kick routine, but
also on other places where we check for ENODEV error.

Reported-by: Richard Genoud <richard.genoud@gmail.com>
Debugged-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/rt2x00/rt2x00usb.c