linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Olsson <exuvo@exuvo.se>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-wireless@vger.kernel.org,
	Helmut Schaa <helmut.schaa@googlemail.com>
Subject: Re: rt2x00 regression
Date: Sun, 5 Apr 2020 06:58:19 +0200	[thread overview]
Message-ID: <a8eeb0bc-95da-291a-7fb9-5d15d1174c27@exuvo.se> (raw)
In-Reply-To: <d74dab51-3a84-9035-d89e-ea8f63e89198@exuvo.se>

So i got around to this again:

Changes to linux-5.6.0 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c were:

static bool rt2x00usb_check_usb_error(struct rt2x00_dev *rt2x00dev, int status)
{
  if (status == -ENODEV || status == -ENOENT)
    return true;

  if (status == -EPROTO || status == -ETIMEDOUT) {
    rt2x00dev->num_proto_errs++;
+    printk("status %d num_proto_errs %u\n", status, rt2x00dev->num_proto_errs);
  } else
    rt2x00dev->num_proto_errs = 0;

- if (rt2x00dev->num_proto_errs > 8)
-    return true;

  return false;
}

Relevant dmesg of boot:
[   37.342405] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3070, rev 0201 detected
[   37.353368] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0005 detected
[   37.353679] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   37.355695] usbcore: registered new interface driver rt2800usb
[   37.357728] rt2800usb 1-3:1.0 wifi: renamed from wlan0
[   72.631902] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[   72.702655] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.36
[   72.728619] status -71 num_proto_errs 1
[   72.728733] status -71 num_proto_errs 2
[   72.728847] status -71 num_proto_errs 3
--same error with nothing else between--
[   72.827518] status -71 num_proto_errs 883
[   72.827520] ieee80211 phy0: rt2x00usb_vendor_request: Error - Vendor Request 0x06 failed for offset 0x0404 with error -71
[   72.908595] status -71 num_proto_errs 884
--same error with nothing else between except ip-table firewall drops--
[   74.651391] status -71 num_proto_errs 935
[   80.098903] IPv6: ADDRCONF(NETDEV_CHANGE): wifi: link becomes ready
-- No more errors after this even when using device in AP mode--

As the error count is very high at the start but no more errors after that i assume some part of the initialization is not supported by my device, any suggestions how to figure out what exactly? Device works fine afterwards, but i have not done any serious connection testing beyond simple transfer test, getting 3MB/s sustained transfer rate both ways which is enough for me.

Anton 'exuvo' Olsson
  +46732193727
  http://exuvo.se

On 2019-12-03 19:50, Anton Olsson wrote:
> | So, revert of that commit makes the problem gone ?
>
> No I have not yet tested that. Have had too much stuff going on and this is kinda low priority for me right now as it currently works on the old kernel.
>
> On 2019-12-03 08:57, Stanislaw Gruszka wrote:
>> On Mon, Dec 02, 2019 at 05:40:20PM +0100, Exuvo wrote:
>>> Sorry for the late reply
>>>
>>> The patch for increasing the amount did not work, i'll get around to
>>> testing with the commit reverted.
>> So, revert of that commit makes the problem gone ?
>>
>>> As an aside what function can i call at that point in the code to print the
>>> value in num_proto_errs? I assume some kernel special printf?
>> It's printk. You can add line like this to print values:
>>
>> printk("status %d num_proto_errs %u\n", status, rt2x00dev->num_proto_errs);
>>
>> Stanislaw
>>
>>
>>> On Fri, 27 Sep 2019, 10:03 Stanislaw Gruszka, <sgruszka@redhat.com> wrote:
>>>
>>>> On Thu, Sep 26, 2019 at 06:32:23PM +0200, Anton Olsson wrote:
>>>>> Hello I have a USB based ID 148f:3070 Ralink Technology, Corp.
>>>> RT2870/RT3070 Wireless Adapter, that stops working with recent kernels. It
>>>> works on kernel 5.1.15 and does not work with 5.2.7 or 5.3.1 (I have not
>>>> tested other versions). I use it in AP mode.
>>>>> I found this similar bug report
>>>> https://marc.info/?l=linux-wireless&m=156630037103575&w=2 but that did
>>>> not have related error messages so I assume this is different?
>>>>> Logs of working kernel 5.1.15-arch1-1-ARCH.
>>>>> [   78.680555] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3070,
>>>> rev 0201 detected
>>>>> [   78.690992] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0005
>>>> detected
>>>>> [   78.799625] ieee80211 phy0: Selected rate control algorithm
>>>> 'minstrel_ht'
>>>>> sep 26 17:13:03 kernel: usbcore: registered new interface driver
>>>> rt2800usb
>>>>> sep 26 17:13:03 systemd[1]: Found device RT2870/RT3070 Wireless Adapter.
>>>>> [  113.812454] ieee80211 phy0: rt2x00lib_request_firmware: Info -
>>>> Loading firmware file 'rt2870.bin'
>>>>> [  113.905279] ieee80211 phy0: rt2x00lib_request_firmware: Info -
>>>> Firmware detected - version: 0.36
>>>>> [  114.028703] ieee80211 phy0: rt2x00usb_vendor_request: Error - Vendor
>>>> Request 0x06 failed for offset 0x0404 with error -71
>>>>> The last error there does not seem to affect the operation of the device.
>>>>>
>>>>> Logs of not working with kernel 5.3.1, 5.2.7 has similar output.
>>>>> sep 26 17:06:12 kernel: ieee80211 phy0: rt2x00_set_rt: Info - RT chipset
>>>> 3070, rev 0201 detected
>>>>> sep 26 17:06:12 kernel: ieee80211 phy0: rt2x00_set_rf: Info - RF chipset
>>>> 0005 detected
>>>>> sep 26 17:06:12 kernel: ieee80211 phy0: Selected rate control algorithm
>>>> 'minstrel_ht'
>>>>> sep 26 17:06:12 kernel: usbcore: registered new interface driver
>>>> rt2800usb
>>>>> sep 26 17:06:12 systemd[1]: Found device RT2870/RT3070 Wireless Adapter.
>>>>> sep 26 17:06:21 ieee80211 phy0: rt2x00lib_request_firmware: Info -
>>>> Loading firmware file 'rt2870.bin'
>>>>> sep 26 17:06:21 ieee80211 phy0: rt2x00lib_request_firmware: Info -
>>>> Firmware detected - version: 0.36
>>>>> sep 26 17:06:21 ieee80211 phy0: rt2x00usb_vendor_request: Error - Vendor
>>>> Request 0x06 failed for offset 0x0404 with>
>>>>> sep 26 17:06:22 ieee80211 phy0: rt2800_wait_csr_ready: Error - Unstable
>>>> hardware
>>>>> sep 26 17:06:22 ieee80211 phy0: rt2800usb_set_device_state: Error -
>>>> Device failed to enter state 4 (-5)
>>>>> Unable to bring up the network interface here.
>>>> This most likely is the problem introduced by commit:
>>>>
>>>> commit e383c70474db32b9d4a3de6dfbd08784d19e6751
>>>> Author: Stanislaw Gruszka <sgruszka@redhat.com>
>>>> Date:   Tue Mar 12 10:51:42 2019 +0100
>>>>
>>>>     rt2x00: check number of EPROTO errors
>>>>
>>>> Plase check below patch that increase number of EPROTO checks
>>>> before marking device removed. If it does not help, plese
>>>> check if reverting above commits helps.
>>>>
>>>> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
>>>> b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
>>>> index bc2dfef0de22..215c3f092306 100644
>>>> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
>>>> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c
>>>> @@ -30,7 +30,7 @@ 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 > 8)
>>>>                 return true;
>>>>
>>>>         return false;
>>>>

  reply	other threads:[~2020-04-05  4:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26 16:32 rt2x00 regression Anton Olsson
2019-09-27  8:03 ` Stanislaw Gruszka
     [not found]   ` <CA+GwT0B5SyRZnGLqwqOeuJK4CWMVc=dKaWre9VN8KQC6kBzKGw@mail.gmail.com>
2019-12-03  7:57     ` Stanislaw Gruszka
2019-12-03 18:50       ` Anton Olsson
2020-04-05  4:58         ` Anton Olsson [this message]
2020-07-15 19:47           ` Anton Olsson
2021-09-29  8:22             ` Exuvo
2021-10-01  6:56               ` Kalle Valo
2021-11-05 13:25                 ` Thorsten Leemhuis
2021-11-08 18:00                   ` Thorsten Leemhuis
     [not found]                     ` <20211109073127.ga109212@wp.pl>
2021-11-09  7:31                     ` Stanislaw Gruszka
2021-11-09 12:07                       ` Stanislaw Gruszka
2021-11-09 15:22                         ` Exuvo
     [not found]                           ` <cc85b4e8a038417b865069c6578acf50@grupawp.pl>
2021-11-10  6:59                             ` Kalle Valo
2021-11-10  8:01                               ` Stanislaw Gruszka
2021-11-11 10:54                                 ` Exuvo
2021-11-11 14:10                                   ` [PATCH] rt2x00: do not mark device gone on EPROTO errors during start Stanislaw Gruszka
2021-11-18  6:16                                     ` Thorsten Leemhuis
2021-11-19 14:19                                       ` Kalle Valo
2021-11-29 10:54                                     ` Kalle Valo
     [not found] <ca+gwt0b5syrznglqwqoeujk4cwmvc=dkawre9vn8kqc6kbzkgw@mail.gmail.com>

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8eeb0bc-95da-291a-7fb9-5d15d1174c27@exuvo.se \
    --to=exuvo@exuvo.se \
    --cc=helmut.schaa@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sgruszka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).