Blank Screen on Hibernate

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

hormati

09-08-2008 20:03:48

Vern,
I've been following this thread to see if I can get my hibernate problem solved. Basically I have the same problem as described here. If I unload my rt2570 driver manually, I can hibernate, otherwise hibernate would fail. I downloaded the latest daily cvs tarball and it seemed that it had all your updates, but still my hibernate fails.

I am using Ubuntu Hardy with 2.6.24-19-generic. I'd appreciate your help.

Thanks,
Amir

Vern

09-08-2008 20:55:26

Please follow the steps described in "Read Me Before Posting"

Thanks,

hormati

09-08-2008 23:24:43

Vern,
I read the "README BEFORE POSTING"
* I tried goolge, ubuntuforums and this forum. I don't think my question is already answered. ?

* Basically, if i do "rmmod rt2570" before hibernate, hibernate successfully finishes. With the rt2570 module being active, I can not hibernate. I just get a blank screen. shock

* I recompiled the latest cvs hourly tarball with debug flag set and attached all the need log files. The attached tar ball includes a copy of the /var/log/debug, var/log/syslog and /var/log/kern.log files right after system startup.

* The output of modinfo is is attached.(info.tar.gz)

* My card is Zonet ZEW2500P. Here is the output of lsusb
Bus 001 Device 002 ID 148f2570 Ralink Technology, Corp. 802.11g WiFi

* I am using 2.6.24-19-generic.

I did not really understand what you meant by saying "read the README". Don't be mad if I missed your point mrgreen

Vern

10-08-2008 15:52:33

Hi hormati,

Took a look at your logs. Some questions

What driver is using the interface "wlan0"? The messages don't correspond to any the rt2570 issues. Need to make sure you don't have two drivers trying to run the same device.

Looks like the rt2570 module is being unloaded before suspend.

[quote3mz1pqn6]With the rt2570 module being active, I can not hibernate. I just get a blank screen.[/quote3mz1pqn6] Sounds like what's supposed to happen to me. What happens if you then press, say, CTL-ALT-F1?

Thanks,

hormati

10-08-2008 16:18:50

Vern,
Thanks a lot for your reply. Here is my ifconfig output
eth0 Link encapEthernet HWaddr 001d7d9c811e
UP BROADCAST MULTICAST MTU1500 Metric1
RX packets0 errors0 dropped0 overruns0 frame0
TX packets0 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen1000
RX bytes0 (0.0 B) TX bytes0 (0.0 B)
Interrupt219 Base address0xc000

lo Link encapLocal Loopback
inet addr127.0.0.1 Mask255.0.0.0
UP LOOPBACK RUNNING MTU16436 Metric1
RX packets2633 errors0 dropped0 overruns0 frame0
TX packets2633 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen0
RX bytes134061 (130.9 KB) TX bytes134061 (130.9 KB)

rausb0 Link encapEthernet HWaddr 0006f40e70e9
inet addr192.168.1.111 Bcast192.168.1.255 Mask255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU1500 Metric1
RX packets33459 errors0 dropped0 overruns0 frame0
TX packets27382 errors0 dropped0 overruns0 carrier0
collisions0 txqueuelen1000
RX bytes67495433 (64.3 MB) TX bytes4399476 (4.1 MB)

As you can see i do not have a wlan0 interface at all. So I don't know exactly what you mean by "What driver is using the interface wlan0". After hiberante freezes, if I press ctrl-alt-delete I go to a terminal which is asking me to login, but my keyboard is locked up.

To make sure that rt2570 is my probelm, I added a script to /etc/pm/sleep.d which rmmods the driver before hibernate and insmods on resume. After copying the script in that directory, my hibernate works. So, it seems that the rt2570 is causing the problem.

What do you exactly mean by "The messages don't correspond to any the rt2570 issues"? I am pretty sure I am using the latest version of rt2570 driver from the cvs and compiled it with -debug. I run the test again and give you the logs again if that helps.

Thanks a lot,

Starcrasher

11-08-2008 12:23:34

Hi hormati,
wlan* is the normal name for a wireless interface. You can have wlan0, wlan1, etc.
In your case, the wireless interface uses the old naming scheme rausb*. and your interface is named rausb0.

(The naming change has been done for rt73 legacy driver and I thought the change was done for rt2570 legacy driver as well.)

The interesting thing is that according your debug file NetworkManager uses an interface named wlan0.
That is the reason Vern asked "What driver is using the interface wlan0 ?".
I think Vern was thinking something like. "It looks like a configuration problem, but I should ask hormati if it's not another interface to be sure."

In fact, NetworkManager deals only with interfaces that are handled by wpa_supplicant. If you use legacy drivers, you surely use iwconfig/iwpriv instead. In this case, it should even not be started nor wpa_supplicant.

hormati

11-08-2008 13:33:53

In fact this was strange for me as well. Because before upgrading to Hardy, my wireless interface name was wlan0 using rt2570 driver. After upgrading to Hardy, I downloaded the latest version and I was expecting to see wlan0 again, but saw rausb0!

For installing the driver, I just downloaded the latest tarball and did a "make" and "make install". In fact I think during "make install", a file named "ralink"(or something like that) was created in /etc/modprobe.d. This files contains "alias rausb0 rt2570" which is I guess the reason I am seeing rausb0 and not wlan0.

Okay, now I am really confused. I'll try to remove the module and get a fresh copy from CVS and install again and see if that help. Do you guys think I am doing something awfully wrong?

Thanks a lot for helping me,

Starcrasher

11-08-2008 15:11:26

Are you really sure that new rt2x00 drivers are not loaded ?
What tells the output of lsmod|grep rt[/color3gph5kvx] ?
If you see that another driver is loaded, then try to blacklist it.
You should have a look in /etc/modprobe.conf too. Maybe you have another line relative to wlan0 there.
In fact I think during "make install", a file named "ralink"(or something like that) was created in /etc/modprobe.d. This files contains "alias rausb0 rt2570" which is I guess the reason I am seeing rausb0 and not wlan0.[/quote3gph5kvx]Indeed this can be the reason.
Maybe, could you try to change this line to "alias wlan0 rt2570" and see what happen after reboot.
Don't forget to change other occurrence of rausb0 to wlan0 in other files.

Vern

11-08-2008 15:48:09

Hi hormati,

Looks like Starcrasher is pretty well sorting things out.[quote591avqk6]I did not really understand what you meant by saying "read the README".[/quote591avqk6]Under the rt2570 directory there's a file named "README". Under the Module subdirectory, there're a pair of files named "TESTING" and "iwpriv_usage.txt" that also have useful information.

Your logs show no indication that the driver's suspend/resume functions are being called. What I use on my system is[code591avqk6]echo test > /sys/power/disk
echo standby > /sys/power/state[/code591avqk6]or[code591avqk6]echo platform > /sys/power/disk
echo disk > /sys/power/state[/code591avqk6]depending on whether I suspend or hibernate. Somewhere in the proceedings, your system needs to be doing likewise.

Thanks,

hormati

15-08-2008 00:55:58

Hey guys,
sorry it took long to get back to you. Couple of points
* I don't know why you are saying that the interface name should be wlan0 instead of rausb0. I checked the make file, and it sets the interface name to rausb0. From what I see in the makefile, it seems that the only distribution that gets wlan0 is fedora.

* I am 100% sure that I am using the right rt2570 driver because I already blacklisted all other related drivers. If I do "lsmod | grep rt" the only result will be rt2570.

* For hibernate, I use pm-hibernate script that comes with the pmutils package.

* Indeed you are right, the drivers hibernate and resume functions are not called. I don't see any of the related messages in my logs. This is really weird.

* I downloaded the latest daily tarball(August 14th version), and performed all the steps again and attached the logs. I am not sure if they are useful or not, because as I said there was no trace of the hibernate/resume functions in the log files.

I don't know what else to do exactly at this point.
Amir

Vern

15-08-2008 15:40:40

Hi hormati,

Does it end up poking the two files I referred you to?

Thanks,

hormati

16-08-2008 08:00:49

So I tried to understand what pm-hibernate is doing. In fact pm-hibernate is calling the do_hibernate function in /usr/lib/pm-utils/functions. Here is the code for do_hibernate

HIBERNATE_METHOD=""
S2DISK_BIN=/usr/sbin/s2disk
S2DISK_CONF=/etc/uswsusp.conf
do_hibernate()

{
if [ -z "$HIBERNATE_METHOD" ]; then
if [ -x $S2DISK_BIN -a -c /dev/snapshot ]; then
HIBERNATE_METHOD="userspace"
else
HIBERNATE_METHOD="kernel"
fi
fi
case $HIBERNATE_METHOD in
userspace)
$S2DISK_BIN -f $S2DISK_CONF
;;
kernel)
echo -n "platform" > /sys/power/disk
echo -n "disk" > /sys/power/state
;;
esac
}

Basically is checks for existence of /usr/sbin/s2disk and /dev/snapshot. If /usr/sbin/s2disk is not there, it pokes the files you referred to. I do not have /usr/sbin/s2disk, so it should be using the "kernel" option and do what you expected. To be 100% sure, I verified this by putting print statements in the case statement. It is using the [i3bbjosy6]$HIBERNATE_METHOD == kernel[/i3bbjosy6] case.

I attached the script so you can take a look at it[in case you don't have the same script on your machine]
Thanks
Amir

hormati

16-08-2008 15:56:43

Another piece of info that might help. I looked into /var/log/pm-suspend.log(attached). It indicates that unloading rt2570 has been unsuccessful. Basically, the hibernate script(pm-hiberante that i attached before) calls another script(/usr/lib/pm-utils/sleep.d/50modules) that tries to rmmod all the network modules, and it seems that rt2570 can not be unloaded because it is still being used by the device. The 50modules script is part of pm-utils and gets called right before hibernate.

Thanks

Vern

18-08-2008 01:13:09

Hi hormati,

If you wish to unload the module, you first have to close the interface it's handling; e.g. "ifconfig rausb0 down".

If you wish to verify the driver's suspend/resume operation, you can (as root) manualy from a console session poke one or the other pair of files I referred to earlier, in the order I referred to them.

Thanks,

hormati

18-08-2008 02:37:22

I know that the interface has to be closed before unloading, but I thought pm-util already does that. Are you saying that pm-utils does not do that and I need to that manually?

Amir

Starcrasher

19-08-2008 11:12:13

Hi Amir,
From my point of view, your problem is the same as before.
Your interface is open once as rausb0, the second time as wlan0. If you shut down rausb0 all processes depending on it will be closed but not those using wlan0 name.
Since they are some processes using it the driver can not be unloaded.

You must setting all programs to use the same name. You can stick with rausb0 if you prefer but be sure to use it everywhere.
Don't start things that are useless too. I'm not sure that processes using wlan0 name at this time are of any use since they should not be able to communicate with the driver.