Re: Sleep problems in kernel 2.6 from mvista.com
El Lunes, 1 de Diciembre de 2003 05:54, Benjamin Herrenschmidt escribió:
> It's indeed strange, I would have expected this config to work fine.
I've also been trying enabling I2C with similar results.
> Do you have X running ? Same problem if not ? Does the screen come back
> up at all or not ?
I've been doing some more tests and the results are random. I tried three
ways of suspending the machine:
1.- Closing the lid (pmud).
2.- Issuing the snooze command (pmud-utils).
3.- Some code I've been playing with some time ago [See below].
The results using (1) and (2) are the same (wether I use the -f option in
(2) or not). It always goes to sleep fine, but when waking up it can
happen one or more of the following things:
* The screen doesn't turn on
* The screen turns on but moving garbage lines appear and the console
columns are shifted to the right (a few places). In X there's only moving
garbage.
* Network doesn't response (so I can't login through ssh and reboot), not
even to pings.
* Keyboard doesn't response (so I can't issue the reboot command).
* Maybe it wakes up correctly (very few times).
* I always hear the CD-ROM initial spin (the same as booting).
If I use (3) the screen doesn't turn off but that could be a coding
mistake.
If you want me to do any particular test or try some kernel configuration
(enabling debugging or so), I would be very please to help comunity; I'm
not worried at all about losing data because everything is mirrored in a
desktop machine.
Thanks for your interest.
Here's some code:
=== sleep.c ===
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/types.h>
#include <linux/pmu.h>
int main(void)
{
int fd;
fd = open("/dev/pmu", 0);
if (fd < 0)
return 1;
sync();
ioctl(fd, PMU_IOC_SLEEP, 0);
close(fd);
return 0;
}
=== ===
P.S: I always wondered where the kernel developers or the system daemons
(i.e. pbbuttonsd and pmud) developres found the ADB and PMU specs to
interact with the respective devices.
Reply to: