On Wed, Nov 10, 2021 at 08:59:22AM +0200, Kalle Valo wrote: > Stanisław Gruszka <stf_xl@xxxxx> writes: > > > Dnia 9 listopada 2021 16:22 Exuvo <exuvo@xxxxxxxx> napisał(a): > > > > Just tested it and it passes the rt2x00lib_load_firmware but still errors on > > rt2800usb_set_device_state: > > > > <snip> > > > > @@ -30,7 +30,8 @@ static bool rt2x00usb_check_usb_error(struct rt2x00_dev *rt2x00dev, int status) > > else > > rt2x00dev->num_proto_errs = 0; > > > > - if (rt2x00dev->num_proto_errs > 3) > > + if (rt2x00dev->num_proto_errs > 3 && > > + !test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) > > return true; > > > > return false; > > > > Sorry, I screwed logic in my patch. It should be test_bit() instead of !test_bit(). > > And also we should not count when device did not start. So patch should be somewhat different. I'll > > send tomorrow hopefully better patch. > > No HTML, please :) I'll reply so that lists see your email. Eh, I sent from my phone to give quick update, did not realize it send in HTML. Anyway, below is updated patch. I hope it will work correctly now. Regards Stanislaw diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index e4473a551241..74c3d8cb3100 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -25,6 +25,9 @@ static bool rt2x00usb_check_usb_error(struct rt2x00_dev *rt2x00dev, int status) if (status == -ENODEV || status == -ENOENT) return true; + if (!test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) + return false; + if (status == -EPROTO || status == -ETIMEDOUT) rt2x00dev->num_proto_errs++; else