diff mbox series

rt2x00: do not mark device gone on EPROTO errors during start

Message ID 20211111141003.GA134627@wp.pl (mailing list archive)
State Accepted
Commit ed53ae75693096f1c10b4561edd31a07b631bd72
Delegated to: Kalle Valo
Headers show
Series rt2x00: do not mark device gone on EPROTO errors during start | expand

Commit Message

Stanislaw Gruszka Nov. 11, 2021, 2:10 p.m. UTC
As reported by Exuvo is possible that we have lot's of EPROTO errors
during device start i.e. firmware load. But after that device works
correctly. Hence marking device gone by few EPROTO errors done by
commit e383c70474db ("rt2x00: check number of EPROTO errors") caused
regression - Exuvo device stop working after kernel update. To fix
disable the check during device start.

Reported-and-tested-by: Exuvo <exuvo@exuvo.se>
Fixes: e383c70474db ("rt2x00: check number of EPROTO errors")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Linux regression tracking (Thorsten Leemhuis) Nov. 18, 2021, 6:16 a.m. UTC | #1
Hi, this is your Linux kernel regression tracker speaking. Thx for this fix.

On 11.11.21 15:10, Stanislaw Gruszka wrote:
> As reported by Exuvo is possible that we have lot's of EPROTO errors
> during device start i.e. firmware load. But after that device works
> correctly. Hence marking device gone by few EPROTO errors done by
> commit e383c70474db ("rt2x00: check number of EPROTO errors") caused
> regression - Exuvo device stop working after kernel update. To fix
> disable the check during device start.
> 
> Reported-and-tested-by: Exuvo <exuvo@exuvo.se>

FWIW: In case you need to send an improved patch, could you
please add this before the 'Reported-by:' (see at (¹) below for the
reasoning):

Link:
https://lore.kernel.org/linux-wireless/bff7d309-a816-6a75-51b6-5928ef4f7a8c@exuvo.se/

And if the patch is already good to go: could the subsystem maintainer
please add it when applying?

> Fixes: e383c70474db ("rt2x00: check number of EPROTO errors")

What's the plan to getting this merged? Just wondering, because there
*afaics* wasn't any activity for a week now. Yes, e383c70474db was a
commit for v5.2-rc1, so it's not a new regression that needs to be
handled really urgently. But it's still a regression that would be good
to get fixed rather sooner than later, as there might be still people
out there then might run into this on a update.

Ciao, Thorsten (carrying his Linux kernel regression tracker hat)


(¹) Long story: The commit message would benefit from a link to the
regression report, for reasons explained in
Documentation/process/submitting-patches.rst. To quote:

```
If related discussions or any other background information behind the
change can be found on the web, add 'Link:' tags pointing to it. In case
your patch fixes a bug, for example, add a tag with a URL referencing
the report in the mailing list archives or a bug tracker; [...]
```

This concept is old, but the text was reworked recently to make this use
case for the Link: tag clearer. For details see:
https://git.kernel.org/linus/1f57bd42b77c

Yes, that "Link:" is not really crucial; but it's good to have if
someone needs to look into the backstory of this change sometime in the
future. But I care for a different reason. I'm tracking this regression
(and others) with regzbot, my Linux kernel regression tracking bot. This
bot will notice if a patch with a Link: tag to a tracked regression gets
posted and record that, which allowed anyone looking into the regression
to quickly gasp the current status from regzbot's webui
(https://linux-regtracking.leemhuis.info/regzbot ) or its reports. The
bot will also notice if a commit with a Link: tag to a regression report
is applied by Linus and then automatically mark the regression as
resolved then.

IOW: this tag makes my life a regression tracker a lot easier, as I
otherwise have to tell regzbot manually when the fix lands. :-/


P.S.: As a Linux kernel regression tracker I'm getting a lot of reports
on my table. I can only look briefly into most of them. Unfortunately
therefore I sometimes will get things wrong or miss something important.
I hope that's not the case here; if you think it is, don't hesitate to
tell me about it in a public reply. That's in everyone's interest, as
what I wrote above might be misleading to everyone reading this; any
suggestion I gave they thus might sent someone reading this down the
wrong rabbit hole, which none of us wants.

BTW, I have no personal interest in this issue, which is tracked using
regzbot, my Linux kernel regression tracking bot
(https://linux-regtracking.leemhuis.info/regzbot/). I'm only posting
this mail to get things rolling again and hence don't need to be CC on
all further activitie wrt to this regression. Ohh, and feel free to
ignore the following lines, they are meant for regzbot:

#regzbot poke

> Cc: stable@vger.kernel.org
> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
> ---
>  drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 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
>
Kalle Valo Nov. 19, 2021, 2:19 p.m. UTC | #2
Thorsten Leemhuis <regressions@leemhuis.info> writes:

> Hi, this is your Linux kernel regression tracker speaking. Thx for this fix.
>
> On 11.11.21 15:10, Stanislaw Gruszka wrote:
>> As reported by Exuvo is possible that we have lot's of EPROTO errors
>> during device start i.e. firmware load. But after that device works
>> correctly. Hence marking device gone by few EPROTO errors done by
>> commit e383c70474db ("rt2x00: check number of EPROTO errors") caused
>> regression - Exuvo device stop working after kernel update. To fix
>> disable the check during device start.
>> 
>> Reported-and-tested-by: Exuvo <exuvo@exuvo.se>
>
> FWIW: In case you need to send an improved patch, could you
> please add this before the 'Reported-by:' (see at (¹) below for the
> reasoning):
>
> Link:
> https://lore.kernel.org/linux-wireless/bff7d309-a816-6a75-51b6-5928ef4f7a8c@exuvo.se/
>
> And if the patch is already good to go: could the subsystem maintainer
> please add it when applying?

Sure, I'll add it during commit.

>> Fixes: e383c70474db ("rt2x00: check number of EPROTO errors")
>
> What's the plan to getting this merged?

My plan is to commit this to wireless-drivers tree, the tree was just
closed due to the merge window.
Kalle Valo Nov. 29, 2021, 10:54 a.m. UTC | #3
Stanislaw Gruszka <stf_xl@wp.pl> wrote:

> As reported by Exuvo is possible that we have lot's of EPROTO errors
> during device start i.e. firmware load. But after that device works
> correctly. Hence marking device gone by few EPROTO errors done by
> commit e383c70474db ("rt2x00: check number of EPROTO errors") caused
> regression - Exuvo device stop working after kernel update. To fix
> disable the check during device start.
> 
> Link: https://lore.kernel.org/linux-wireless/bff7d309-a816-6a75-51b6-5928ef4f7a8c@exuvo.se/
> Reported-and-tested-by: Exuvo <exuvo@exuvo.se>
> Fixes: e383c70474db ("rt2x00: check number of EPROTO errors")
> Cc: stable@vger.kernel.org
> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>

Patch applied to wireless-drivers.git, thanks.

ed53ae756930 rt2x00: do not mark device gone on EPROTO errors during start
diff mbox series

Patch

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