[Solved]Problem with resume from suspend with rt2500usb

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=5233

4javier

25-03-2009 10:50:03

Hi all, and sorry for my poor english.

I have a belkin usb wireless receiver,
[code1qxboqra]Bus 001 Device 004: ID 050d:7050 Belkin Components F5D7050 ver 1000 WiFi
[/code1qxboqra]
working fine with rt2500usb (except the led that doesn't work), until i suspend my pc. At the resume, wifi is disconnected, and the power signal of my receiver seems to be mooooooooore lower then before. 95% of iwlist scan doesn't recognize any network, the remaining 5 recognize my net, but not the others two that it found before suspending. Connect tries fail (probably due to the poor power signal)
[code1qxboqra][javier@archbox ~]$ ifconfig
wlan0 Link encap:Ethernet HWaddr 00:11:50:89:4F:B3
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:47264 errors:0 dropped:0 overruns:0 frame:0
TX packets:27491 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:67198430 (64.0 Mb) TX bytes:2619555 (2.4 Mb)

wmaster0 Link encap:UNSPEC HWaddr 00-11-50-89-4F-B3-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[javier@archbox ~]$ iwconfig
wlan0 IEEE 802.11bg ESSID:"Alice-96256190"
Mode:Managed Frequency:2.462 GHz Access Point: Not-Associated
Tx-Power=20 dBm
Retry min limit:7 RTS thr:off Fragment thr=2352 B
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

[/code1qxboqra]
This is my pm-suspend log (don't care about video error, I have to rmmod fglrx to go in suspend)
[code1qxboqra]bash-3.2# cat /var/log/pm-suspend.log
Initial commandline parameters:
mer mar 25 11:16:17 CET 2009: Running hooks for suspend.
/usr/lib/pm-utils/sleep.d/00auto-quirk suspend suspend: Adding quirks from HAL: --quirk-dpms-on --quirk-dpms-suspend --quirk-vbe-post --quirk-vbemode-restore --quirk-vbestate-restore --quirk-vga-mode-3
success.
/usr/lib/pm-utils/sleep.d/00logging suspend suspend: Linux archbox 2.6.28-ARCH #1 SMP PREEMPT Tue Mar 17 06:42:43 UTC 2009 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux
Module Size Used by
it87 21904 0
hwmon_vid 4864 1 it87
ext2 66184 1
arc4 3712 2
ecb 4608 2
rt2500usb 21248 0
rt2x00usb 11008 1 rt2500usb
rt2x00lib 29056 2 rt2500usb,rt2x00usb
rfkill 11596 2 rt2x00lib
led_class 5508 1 rt2x00lib
mac80211 161184 2 rt2x00usb,rt2x00lib
cfg80211 31760 2 rt2x00lib,mac80211
usb_storage 95552 0
ppdev 9348 0
lp 11108 0
serio_raw 7172 0
psmouse 55828 0
i2c_i801 10896 0
i2c_core 22804 1 i2c_i801
ohci1394 31280 0
ieee1394 79940 1 ohci1394
sg 26804 0
iTCO_wdt 12836 0
iTCO_vendor_support 4996 1 iTCO_wdt
parport_pc 37700 1
parport 33004 3 ppdev,lp,parport_pc
uhci_hcd 24592 0
ehci_hcd 37388 0
usbcore 136848 6 rt2500usb,rt2x00usb,usb_storage,uhci_hcd,ehci_hcd
intel_agp 27836 0
agpgart 31572 1 intel_agp
evdev 11296 3
thermal 17180 0
processor 41388 1 thermal
fan 6276 0
button 7824 0
battery 12036 0
ac 6020 0
snd_seq_oss 31872 0
snd_seq_midi_event 8192 1 snd_seq_oss
snd_seq 49968 4 snd_seq_oss,snd_seq_midi_event
snd_seq_device 8204 2 snd_seq_oss,snd_seq
snd_hda_intel 412980 0
snd_hwdep 9092 1 snd_hda_intel
snd_pcm_oss 40192 0
snd_pcm 70020 2 snd_hda_intel,snd_pcm_oss
snd_timer 21384 2 snd_seq,snd_pcm
snd_page_alloc 10120 2 snd_hda_intel,snd_pcm
snd_mixer_oss 16512 1 snd_pcm_oss
snd 50980 9 snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hwdep,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss
soundcore 8160 1 snd
slhc 7552 0
8139too 25604 0
8139cp 21888 0
mii 6528 2 8139too,8139cp
rtc_cmos 12332 0
rtc_core 17564 1 rtc_cmos
rtc_lib 4480 1 rtc_core
ext3 127112 2
jbd 46996 1 ext3
mbcache 8708 2 ext2,ext3
sd_mod 27036 5
sr_mod 16708 0
cdrom 35360 1 sr_mod
ata_piix 23300 4
ata_generic 6788 0
pata_acpi 6016 0
libata 157856 3 ata_piix,ata_generic,pata_acpi
scsi_mod 102164 5 usb_storage,sg,sd_mod,sr_mod,libata
total used free shared buffers cached
Mem: 1034696 120552 914144 0 8560 79844
-/+ buffers/cache: 32148 1002548
Swap: 530136 0 530136
success.
/usr/lib/pm-utils/sleep.d/00powersave suspend suspend: success.
/usr/lib/pm-utils/sleep.d/01grub suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/11netcfg suspend suspend: success.
/usr/lib/pm-utils/sleep.d/49bluetooth suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/55NetworkManager suspend suspend: success.
/usr/lib/pm-utils/sleep.d/55wicd suspend suspend: success.
/usr/lib/pm-utils/sleep.d/75modules suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/90chvt suspend suspend: success.
/usr/lib/pm-utils/sleep.d/90clock suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend: success.
/usr/lib/pm-utils/sleep.d/95led suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video suspend suspend: not applicable.
/usr/lib/pm-utils/sleep.d/99video suspend suspend: kernel.acpi_video_flags = 0
Get video state buffer size failed
Allocated buffer at 0x2010 (base is 0x0)
ES: 0x0201 EBX: 0x0000
Save video state failed
success.
mer mar 25 11:16:18 CET 2009: performing suspend
mer mar 25 11:16:32 CET 2009: Awake.
mer mar 25 11:16:32 CET 2009: Running hooks for resume
/usr/lib/pm-utils/sleep.d/99video resume suspend: Function not supported
Restore video state failed
Function not supported
success.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video resume suspend: success.
/usr/lib/pm-utils/sleep.d/95led resume suspend: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq resume suspend: success.
/usr/lib/pm-utils/sleep.d/90clock resume suspend: not applicable.
/usr/lib/pm-utils/sleep.d/90chvt resume suspend: success.
/usr/lib/pm-utils/sleep.d/75modules resume suspend: success.
/usr/lib/pm-utils/sleep.d/55wicd resume suspend: success.
/usr/lib/pm-utils/sleep.d/55NetworkManager resume suspend: success.
/usr/lib/pm-utils/sleep.d/49bluetooth resume suspend: not applicable.
/usr/lib/pm-utils/sleep.d/11netcfg resume suspend: success.
/usr/lib/pm-utils/sleep.d/01grub resume suspend: not applicable.
/usr/lib/pm-utils/sleep.d/00powersave resume suspend: success.
/usr/lib/pm-utils/sleep.d/00logging resume suspend: success.
/usr/lib/pm-utils/sleep.d/00auto-quirk resume suspend: success.
mer mar 25 11:16:37 CET 2009: Finished.[/code1qxboqra]


and this is the interesting part of my dmesg (let me now if you need the rest)
[code1qxboqra]cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
phy0: Selected rate control algorithm 'pid'
Registered led device: rt2500usb-phy0:radio
usbcore: registered new interface driver rt2500usb[/code1qxboqra]
(Why it sets crda for US if I'm from Italy???)
Before I blacklisted 'em, the system loaded the modules rt73usb and p54usb (nothing's changed)

Sorry for the length of the post roll

IvD

25-03-2009 11:07:43

Which kernel are you using?


(Why it sets crda for US if I'm from Italy???)
[/quotef7y1jzz1]

Because you didn't specify anywhere that you are in Italy. ;)
You need to configure the correct country code yourself, although according to the Ralink specs the device does hold some information about the region it was distributed the specs indicate that information should not be used. So setting the correct country region completely relies on userspace configuration for the information.

4javier

25-03-2009 12:56:41

[quote2nk5udel]/usr/lib/pm-utils/sleep.d/00logging suspend suspend Linux archbox [b2nk5udel][u2nk5udel]2.6.28[/u2nk5udel][/b2nk5udel]-ARCH #1 SMP PREEMPT Tue Mar 17 064243 UTC 2009 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux[/quote2nk5udel]

Thanks for the reply, in the near future i will take a look to crda.

IvD

25-03-2009 13:14:10

I looked over your initial post a couple of times and completely overlooked that line with the kernel version. oops

Could you use the register dump script: http//kernel.org/pub/linux/kernel/peop ... regdump.sh
and create a dump before and after the suspend & resume cycle?

Note that you need to enable CONFIG_DEBUGFS, CONFIG_MAC80211_DEBUGFS and CONFIG_RT2X00_LIB_DEBUGFS
and mount debugfs.

4javier

25-03-2009 13:37:12

[quote3ha6oc73]I looked over your initial post a couple of times and completely overlooked that line with the kernel version. [/quote3ha6oc73]
D


[quote3ha6oc73]Note that you need to enable CONFIG_DEBUGFS, CONFIG_MAC80211_DEBUGFS and CONFIG_RT2X00_LIB_DEBUGFS
and mount debugfs[/quote3ha6oc73]
ehmmmmmmmm, are you talking about kernel compiling flags? I never compiled the kernel, is it really necessary? ?

IvD

25-03-2009 13:41:26

Try mounting debugfs, perhaps (very likely) your distribution has enabled it by default.

4javier

25-03-2009 14:19:14

sorry, I'm a dumb...
Have I to mount debugfs on my /?
How can I do it? oops

Edit
I mounted debugfs in this way
[code1cfoorqr]mount -t debugfs none /sys/kernel/debug[/code1cfoorqr]
but when I run the script, this is what I get
[code1cfoorqr]ls: impossibile accedere a /sys/kernel/debug/ieee80211/phy*/rt[0-9]*/: No such file or directory[/code1cfoorqr]
Where I'm doing wrong?

The directory ieee80211 contains phy0, but phy0 is empty ?

IvD

25-03-2009 14:51:27

Not sure about this, but is your wireless interface active when you checkec the contents of that folder?

4javier

25-03-2009 15:01:58

Yes, I'm connected by that.
I didn't do anything about this, CONFIG_MAC80211_DEBUGFS and CONFIG_RT2X00_LIB_DEBUGFS
Is there something I have to do?

IvD

25-03-2009 15:05:46

Yes, I'm connected by that.
I didn't do anything about this, CONFIG_MAC80211_DEBUGFS and CONFIG_RT2X00_LIB_DEBUGFS [/quote3jeexaxn]

Since you have the /sys/kernel/debug/ieee80211/phy* folder you have at least CONFIG_MAC80211_DEBUGFS enabled.
But I don't understand why the folder is empty, there should be multiple files/folders in that directory.

Please use this command
[code3jeexaxn]cat /proc/config.gz | gunzip | grep DEBUGFS[/code3jeexaxn]
this will display if all required config options have been enabled.

4javier

25-03-2009 15:07:23

issue found (
[code2s2a024c] CONFIG_MAC80211_DEBUGFS is not set
[/code2s2a024c]

IvD

25-03-2009 15:17:31

Weird that the directory is created even when mac80211 doesn't support it, on the other hand... that means that CONFIG_RT2X00_LIB_DEBUGFS doesn't need to depend on it..

Anyway, I'm afraid that you still have to recompile your kernel with the previous mentioned options enabled. (

4javier

25-03-2009 22:34:17

Finally I have the dump lol

before
[edit by IvD]added as attachment[/edit]

after
[edit by IvD]added as attachment[/edit]

IvD

25-03-2009 22:44:47

Thanks, I'll look into it.

I edited your post because adding things like this inline is making the entire thread unreadable, and offcourse we have a very cool attachment feature on this forum. ;)

4javier

26-03-2009 00:25:10

Sorry admin, when I posted I thought that the text in code tag would have been shown in a scrollable frame. mrgreen

IvD

26-03-2009 16:41:24

Sorry admin, when I posted I thought that the text in code tag would have been shown in a scrollable frame. mrgreen[/quote1k1opbmw]

Even then, attachments are so much better. ;)

In any case, could you download the compat-wireless package from http//www.linuxwireless.org/ and try the driver in there? That is a more recent version then 2.6.28.

4javier

26-03-2009 17:00:47

Latest drivers are included in .29 kernel? If it's so, I will directly install it, that's in the testing repo of my distro.

IvD

26-03-2009 17:34:49

.29 kernel is also fine. )

4javier

26-03-2009 18:03:52

nothing's changed cry

IvD

26-03-2009 19:48:02

Could you try this patch?

4javier

26-03-2009 21:20:26

Have I to rebuild the kernel again? (

4javier

27-03-2009 14:51:08

YOU'RE GREAT!!!!!![/size29w1fnea]

now it seems to work perfectly, after a resume, scan finds every network, and when it wakes-up it's already connected.
The led doesn't work nor before nor after the resume, but this is not a real problem.
Do you think this patch will be included in next kernel release?

Anyway, thanks a lot. D


EDIT
What a cruel patch cry

First resume/suspend goes right, the second time in session I try to run pm-suspend, screen goes black but the rest of the pc seems to be active, and I cannot nor complete suspend, nor resume my pc.
I made a dump before the first suspend, and after the resume, i cannot make one later, cause I have to power-off the pc.
I think there's offset between them.

EDIT2
Sorry for the hoax.
The problem appears on non patched kernel .29 also. So it's a different problem. (I'm really a lucky guy ... evil )
Thanks again

IvD

27-03-2009 18:06:05

YOU'RE GREAT!!!!!![/size1187e95f]
[/quote1187e95f]

mrgreen


now it seems to work perfectly, after a resume, scan finds every network, and when it wakes-up it's already connected.
The led doesn't work nor before nor after the resume, but this is not a real problem.
Do you think this patch will be included in next kernel release?
[/quote1187e95f]

Absolutely, I'll cleanup the patch a bit, but now that I know it is working
I'll push this upstream as soon as possible. It will at least appear in 2.6.30,
perhaps I can push it into 2.6.29-stable as well.

4javier

30-03-2009 21:45:24

If you'll be able to make include this patch in 2.6.29, could you post here to warn me about that?

Thanks D

newton

24-04-2009 09:39:58

I'm using a rt73usb based DeLock 95801 mini PCI Express ID 18e86229 in a Lenovo IdeaPad S10e, vanilla 2.6.29.

Unfortunately, the patch does not help here - machine does not resume from suspend.

The wlan led keeps blinking as it does when the firmware is not yet loaded and the machine hangs, display not activated.

Machine has no serial port, so I cannot see if there is any information on console.