You are not logged in.

#1 2012-02-27 07:47:11

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

[RESOLVED] Linux 3.2 bug rt2800pci

I've been trying to handle this myself for a while but I'm making no progress. I've tried looking for known issues (any known issues) with the rt2800pci driver, but most results are from when rt2800sta was still in use, with almost nothing since. There recently have been a number of issues with other drivers, but none of their solutions have helped me. hmm There are some bugs (mostly old) posted for rt2800pci, but nothing like what I'm dealing with, so I added one.

I'm wondering if anyone has experienced anything like what's described below or if they have any ideas on a solution. I'm not really sure what can be done now, if there's anything I can do now. Unlike many people here, I really, don't like the idea of downgrading. It feels like defeat. sad

------------------------------The Problem------------------------------
The driver for my NIC chokes after too much data is passed through it.

The NIC:

05:00.0 Network controller: Ralink corp. RT2800 802.11n PCI
	Subsystem: Ralink corp. Device 2860
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32 (500ns min, 1000ns max), Cache Line Size: 4 bytes
	Interrupt: pin A routed to IRQ 19
	Region 0: Memory at fbef0000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Kernel driver in use: rt2800pci

"Too much data": I can maintain a mostly (possibly for a few hours) stable connection if I throttle the network traffic to between 7 and 10 kb/s up and down; however, prolonged traffic at higher rates will cause the interface to
choke. The higher the rate, the quicker it happens. For example, rates up to and over 50 kb/s are possible but only for less than a minute. The exact amount of time seems to vary a bit. If the execessive network usage is brief enough, the interface seems to stay functional there after, but with a seemingly reduced threshhold.

"Choke": Ifconfig and iwconfig will continue to report the interface as being associated to an AP and having an IP address, but any attempts to reach the wider Internet or LAN (even the local gateway) will result in a pause followed by an unknown host error for any application that tries. Ifconfig and iwconfig's output remains constant, as if there's no problem, throught this whole process.

The reason I'm worried this could be a bug in the kernel and/or driver:
I found I can restart the interface's usefulness after choking, by reloading the driver module. However, it must be unloaded and reloaded twice. Once is not enough. These strange symtoms will continue --for as long as I try-- until I perform a second unload/reload cycle. That is to say I must:

# modprobe -r rt2800pci
# modprobe rt2800pci
# modprobe -r rt2800pci
# modprobe rt2800pci
# dhcpcd wlan0

before my connection will work again. I can do this an unlimited number of times to keep my connection running, but I do notice it sometimes breaks faster after several unload/reload cycles that happened close together.

Additionaly, I spot these errors over dmesg:

phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response from
hardware
rt2800pci 0000:05:00.0: PCI INT A disabled 
rt2800pci 0000:05:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
Registered led device: rt2800pci-phy0::radio
Registered led device: rt2800pci-phy0::assoc
Registered led device: rt2800pci-phy0::quality

Last edited by Avant-texte (2012-02-29 14:36:57)

Offline

#2 2012-02-27 09:32:30

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Patch: http://www.spinics.net/lists/linux-wire … 85339.html

It's not in any kernels yet. You can either wait for a kernel release that has the patch included, or you compile your own kernel.

Offline

#3 2012-02-27 12:52:47

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [RESOLVED] Linux 3.2 bug rt2800pci

@Avant-texte, you are more of a man than I am. Should rt2800pci work? Yes. Does it work? No.

I always download and install the driver from Ralink, because it does work.

Tim

Offline

#4 2012-02-27 18:33:33

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Gusar wrote:

Patch: http://www.spinics.net/lists/linux-wire … 85339.html

It's not in any kernels yet. You can either wait for a kernel release that has the patch included, or you compile your own kernel.

Yay; a patch! If I'm lucky the MTU issue it patches might even be the cause of the bad connections.

But, ugggh. I tried to apply the patch, as is, to the kernel and the build failed. It died once it hit Ralink related stuff. While this isn't my first time compiling a kernel, I have little experience patching kernels. This is what I put in the .patch file:

Bring MCU operations during device initialization to sync
with legacy driver.

This should fix following error:
phy0 -> rt2800pci_mcu_status: Error - MCU request failed,
no response from hardware

Signed-off-by: Jakub Kicinski <kubakici@xxxxx>
---
v3: move code from switch statement to appropriate function.
---
 drivers/net/wireless/rt2x00/rt2800pci.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 891547c..ac874db 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -501,11 +501,27 @@ static int rt2800pci_init_registers(struct rt2x00_dev *rt2x00dev)
 
 static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev)
 {
+	int retval;
+
 	if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev) ||
 		     rt2800pci_init_queues(rt2x00dev)))
 		return -EIO;
 
-	return rt2800_enable_radio(rt2x00dev);
+	retval = rt2800_enable_radio(rt2x00dev);
+	if (retval)
+		return retval;
+
+	/* After resume MCU_BOOT_SIGNAL will trash these. */
+	rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
+	rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
+
+	rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_RADIO_OFF, 0xff, 0x02);
+	rt2800pci_mcu_status(rt2x00dev, TOKEN_RADIO_OFF);
+
+	rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP, 0, 0);
+	rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
+
+	return retval;
 }
 
 static void rt2800pci_disable_radio(struct rt2x00_dev *rt2x00dev)
@@ -543,13 +559,6 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
 
 	switch (state) {
 	case STATE_RADIO_ON:
-		/*
-		 * Before the radio can be enabled, the device first has
-		 * to be woken up. After that it needs a bit of time
-		 * to be fully awake and then the radio can be enabled.
-		 */
-		rt2800pci_set_state(rt2x00dev, STATE_AWAKE);
-		msleep(1);
 		retval = rt2800pci_enable_radio(rt2x00dev);
 		break;
 	case STATE_RADIO_OFF:

Is there some extra directive that I missed which needs to be added?

ratcheer wrote:

@Avant-texte, you are more of a man than I am. Should rt2800pci work? Yes. Does it work? No.

I always download and install the driver from Ralink, because it does work.

Tim

Well, it did seem to work just fine pre-3.2. *lol*

Where do you get the driver from. I like sticking to official website when directly downloading drivers, but I can't find anything for rt2800 in their download section.

Offline

#5 2012-02-27 18:41:14

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [RESOLVED] Linux 3.2 bug rt2800pci

I tried the patch, it fails to compile here too. Hmm, it's a 2/2 patch, perhaps 1/2 is needed too. It kinda seemed like two separate patches, but maybe they're not. Let me check.

Indeed, the first patch: http://www.spinics.net/lists/linux-wire … 85338.html defines TOKEN_WAKEUP, where my compilation failed. So apply both patches and try again.

Offline

#6 2012-02-27 19:59:51

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Gusar wrote:

I tried the patch, it fails to compile here too. Hmm, it's a 2/2 patch, perhaps 1/2 is needed too. It kinda seemed like two separate patches, but maybe they're not. Let me check.

Indeed, the first patch: http://www.spinics.net/lists/linux-wire … 85338.html defines TOKEN_WAKEUP, where my compilation failed. So apply both patches and try again.

Good to know. At first glance, 1/2 just looked like documentation. Give me a few to check.

Offline

#7 2012-02-28 01:23:56

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Avant-texte wrote:

Where do you get the driver from. I like sticking to official website when directly downloading drivers, but I can't find anything for rt2800 in their download section.

This looks like it should be the right one for you, the tenth one down the list: http://www.ralinktech.com/en/04_support … php?sn=501

Tim

Offline

#8 2012-02-29 04:15:55

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Firstly, thank you for your replies. smile

Avant-texte wrote:
Gusar wrote:

I tried the patch, it fails to compile here too. Hmm, it's a 2/2 patch, perhaps 1/2 is needed too. It kinda seemed like two separate patches, but maybe they're not. Let me check.

Indeed, the first patch: http://www.spinics.net/lists/linux-wire … 85338.html defines TOKEN_WAKEUP, where my compilation failed. So apply both patches and try again.

Good to know. At first glance, 1/2 just looked like documentation. Give me a few to check.

Yes, 1/2 + 2/2 lead to a successful compile. On the plus side, my kernel seems to be working just fine and it's no longer throwing MCU errors.

An inspection via `dmesg | grep phy` gives me nicer looking messages about my NIC.

ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Registered led device: rt2800pci-phy0::radio
Registered led device: rt2800pci-phy0::assoc
Registered led device: rt2800pci-phy0::quality

On the down side, I still have the same connection issues! sad
I doubted it would solve anything as I saw the MCU errors with older kernels, back when it was still working, but I hoped.

ratcheer wrote:
Avant-texte wrote:

Where do you get the driver from. I like sticking to official website when directly downloading drivers, but I can't find anything for rt2800 in their download section.

This looks like it should be the right one for you, the tenth one down the list: http://www.ralinktech.com/en/04_support … php?sn=501

Tim

Thank you for the link. Since it lacked 'rt2800' in its title line, I passed it over for a closely related driver.

My browser claims to get the whole file each time I try, but the contents of the tarball aren't extractable. I don't know if the driver is corrupt on their end or if it's being damaged en route. I can't be sure of what's going on since they don't have a static link for me to point wget at (I hate those kinds of dl pages), so I'll have to try again with a live disc, to rule out the system's support for my NIC.

Here's a question I would like to throw by anyone who may be more knowlegeable on kernel inerworkings: could my problem be due to kmod? My network problems did start after a kernel upgrade, but module-init-tools was also replaced by kmod durring that system update. I'e been wondering if it's the kernel itself or the module handling faculties. As I said above, I did notice oddities in how the kernel module is loaded. ...it's hard to know for certain when both of those things were changed at once.

I would have tried switching back to module-init-tools, from kmod, to see if that's the case, but it looks like it's been pulled from the repos and I don't have it cached.

Last edited by Avant-texte (2012-02-29 04:17:56)

Offline

#9 2012-02-29 04:19:52

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [RESOLVED] Linux 3.2 bug rt2800pci

I recall writing a post once that said "I love it how kmod is being blamed for everything that is wrong in this world" smile

Offline

#10 2012-02-29 04:24:18

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Gusar wrote:

I recall writing a post once that said "I love it how kmod is being blamed for everything that is wrong in this world" smile

That could have been me. -_____- I know I threw the idea out once before.

But, I can't help but wonder since it was moved onto my system with the kernel upgrade. If module-init-tools were kept in the repos for a bit longer, I could have quickly ruled out kmod or had more than speculation if it is the cause. sad

EDIT:
Now that I think about it, maybe the ARM will still have a copy.

EDIT2:
I'll try it tomorrow. BTW, if anyone can think of a system compatibility issue I've oerlooked with switching from kmod back to module-init-tools, please post a warning. smile A lot of stuff has been recompiled and such...

Last edited by Avant-texte (2012-02-29 04:35:09)

Offline

#11 2012-02-29 04:35:34

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Chances that it's kmod are pretty much zero. I mean, the thing loads modules. What can go wrong with that except failing to load it?

It makes a lot more sense that the kernel is at fault. Especially when the rt2800 driver isn't the only one with issues.

PS. You won't be able to go back to module-init-tools unless you also downgrade udev to 175. Which might not go smoothly, considering how much that version is different from the current udev.

Offline

#12 2012-02-29 05:14:18

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Gusar wrote:

Chances that it's kmod are pretty much zero. I mean, the thing loads modules. What can go wrong with that except failing to load it?

That's what you'd hope, but I've seen weirder. *lol*

Gusar wrote:

PS. You won't be able to go back to module-init-tools unless you also downgrade udev to 175. Which might not go smoothly, considering how much that version is different from the current udev.

Yea, I was trying to pick the least dependancy ridden way. If that's the case, than kernel 3.0.x it is.

I'll report back after I try downgrading or switching to lts.

Offline

#13 2012-02-29 14:34:33

Avant-texte
Member
Registered: 2012-02-13
Posts: 136

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Well as it turns out, I wasn't downgradinging far enough. It seems 3.0.22.-1 is old enough, though.

This has inspired me to keep lts on my system as a permanent back up kernel.

Renaming the thread to be a little more descriptive and marking solved resolved (the problem itself wasn't actually solved).



@Gusar, and for the record, I would have been very dissapointed if kmod was the cause (somehow mangling modules on initialization).

Last edited by Avant-texte (2012-02-29 14:39:09)

Offline

#14 2012-04-22 13:46:17

EdCates
Member
Registered: 2012-04-22
Posts: 3

Re: [RESOLVED] Linux 3.2 bug rt2800pci

I just wanted to chime in here for anyone finding this thread via a search and say that yes, the patches linked to in this thread still apply cleanly to 3.3.1-1-ARCH. In a few minutes days I'll find out if it fixes my own rt2800pci problems.

Offline

#15 2013-12-04 10:28:39

bogdan2011
Member
Registered: 2012-01-13
Posts: 44

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Just wanted to post my experience with rt2800pci.
The connection works fine on openSUSE with the latest kernel (KOTD), which is my main workstation.
I could even install arch over wifi, configuration is easy with wifi-menu, it can see all available network and I have a stable connection.
However, after installing arch, I can't get the connection up with dhcpcd, nor with networkmanager.

Last edited by bogdan2011 (2013-12-04 10:29:34)

Offline

#16 2013-12-04 14:15:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [RESOLVED] Linux 3.2 bug rt2800pci

Hi bogdan2011,

If you are having problems, I am going to suggest you start a new thread and link back to this one.  This one had pretty much reached its end a year and a half ago; much has changed since then.

Closing https://wiki.archlinux.org/index.php/Fo … Bumping.22


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB