OSDN Git Service

rt2x00: check number of EPROTO errors
authorStanislaw Gruszka <sgruszka@redhat.com>
Tue, 12 Mar 2019 09:51:42 +0000 (10:51 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 25 Apr 2019 16:40:53 +0000 (19:40 +0300)
commite383c70474db32b9d4a3de6dfbd08784d19e6751
treed8af3360d26de89f63b8484331ef9609d8d757b6
parentbb3b18c925333695261ccaad84c0edc100a4d9e2
rt2x00: check number of EPROTO errors

Some USB host devices/drivers on some conditions can always return
EPROTO error on submitted URBs. That can cause infinity loop in the
rt2x00 driver.

Since we can have single EPROTO errors we can not mark as device as
removed to avoid infinity loop. However we can count consecutive
EPROTO errors and mark device as removed if get lot of it.
I choose number 10 as threshold.

Reported-and-tested-by: Randy Oostdyk <linux-kernel@oostdyk.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2x00.h
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c