Slightly more accurate comments re: Kobo suspend

pull/1863/head
NiLuJe 8 years ago
parent fe13af9d7e
commit 06e1bd4ed2

@ -1,4 +1,4 @@
## On the other hand, nickel doesn't seem to fare any better... it spends its time doing this over and over:
## On the other hand, nickel doesn't seem to fare any better... when the suspend to ram fails, it spends its time doing this over and over:
# strace -fitv -P /sys/power/state -P /sys/power/state-extended -P /sys/power/wakeup_count -p $(pidof nickel)
strace: Process 4474 attached
@ -62,3 +62,30 @@ strace: Process 4479 attached
[pid 3681] 19:38:50 [2f0d62f4] write(26, "0", 1) = 1
[pid 3681] 19:38:50 [2f0d6454] close(26) = 0
## Compared to a successful suspend/wakeup cycle:
522 00:59:53 [2f0d8386] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1291, si_uid=0, si_status=0, si_utime=0, si_stime=1} ---
522 00:59:54 [2f0d8386] open("/sys/power/wakeup_count", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 21
522 00:59:54 [2f0d8386] fcntl64(21, F_SETFD, FD_CLOEXEC) = 0
522 00:59:54 [2f232276] fstat64(21, {st_dev=makedev(0, 14), st_ino=36, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016/03/01-00:52:55.478751029, st_mtime=2016/03/01-00:52:55.478751029, st_ctime=2016/03/01-00:52:55.478751029}) = 0
522 00:59:54 [2f232276] fstat64(21, {st_dev=makedev(0, 14), st_ino=36, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016/03/01-00:52:55.478751029, st_mtime=2016/03/01-00:52:55.478751029, st_ctime=2016/03/01-00:52:55.478751029}) = 0
522 00:59:54 [2f232276] fstat64(21, {st_dev=makedev(0, 14), st_ino=36, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016/03/01-00:52:55.478751029, st_mtime=2016/03/01-00:52:55.478751029, st_ctime=2016/03/01-00:52:55.478751029}) = 0
522 00:59:54 [2f0d63a4] read(21, "93\n", 16384) = 3
522 00:59:54 [2f0d63a4] read(21, "", 16381) = 0
522 00:59:54 [2f0d63a4] read(21, "", 4093) = 0
522 00:59:54 [2f0d6454] close(21) = 0
522 00:59:54 [2f0d8386] open("/sys/power/state-extended", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE|O_CLOEXEC, 0666) = 24
522 00:59:54 [2f0d8386] fcntl64(24, F_SETFD, FD_CLOEXEC) = 0
522 00:59:54 [2f232276] fstat64(24, {st_dev=makedev(0, 14), st_ino=38, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016/03/01-00:59:54.358750902, st_mtime=2016/03/01-00:59:54.358750902, st_ctime=2016/03/01-00:59:54.358750902}) = 0
522 00:59:54 [2f0d62f4] write(24, "1", 1) = 1
522 00:59:54 [2f0d6454] close(24) = 0
522 00:59:54 [2f0d8386] open("/sys/power/state", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE|O_CLOEXEC, 0666) = 24
522 00:59:54 [2f0d8386] fcntl64(24, F_SETFD, FD_CLOEXEC) = 0
522 00:59:54 [2f232276] fstat64(24, {st_dev=makedev(0, 14), st_ino=33, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016/03/01-00:59:54.358750902, st_mtime=2016/03/01-00:59:54.358750902, st_ctime=2016/03/01-00:59:54.358750902}) = 0
522 00:59:54 [2f0d62f4] write(24, "mem", 3) = 3
522 01:00:27 [2f0d6454] close(24) = 0
522 01:00:27 [2f0d8386] open("/sys/power/state-extended", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE|O_CLOEXEC, 0666) = 24
522 01:00:27 [2f0d8386] fcntl64(24, F_SETFD, FD_CLOEXEC) = 0
522 01:00:27 [2f232276] fstat64(24, {st_dev=makedev(0, 14), st_ino=38, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016/03/01-00:59:54.358750902, st_mtime=2016/03/01-01:00:27.398750985, st_ctime=2016/03/01-01:00:27.398750985}) = 0
522 01:00:27 [2f0d62f4] write(24, "0", 1) = 1
522 01:00:27 [2f0d6454] close(24) = 0

@ -24,9 +24,11 @@ echo ${current_wakeup_count} > /sys/power/wakeup_count
echo "[$(date +'%x @ %X')] Kobo Suspend: Wrote WakeUp count: ${current_wakeup_count} ($?)"
echo mem > /sys/power/state
echo "[$(date +'%x @ %X')] Kobo Suspend: Asked to suspend to RAM... ZzZ ZzZ ZzZ? ($?)"
## And nickel apparently loops like a crazy person if the write to /sys/power/state returns EBUSY...
#echo 0 > /sys/power/state-extended
#echo "Kobo Suspend: Asked to wakeup"
## NOTE: Ideally, we'd need a way to warn the user that suspending gloriously failed at this point...
## We can safely assume that just from a non-zero return code, without looking at the detailed stderr message
## (most of the failures we'll see are -EBUSY anyway)
## For reference, when that happens to nickel, it appears to keep retrying to wakeup & sleep ad nauseam,
## which is where the non-sensical 1 -> mem -> 0 loop idea comes from...
## cf. nickel_suspend_strace.txt for more details.
echo "[$(date +'%x @ %X')] Kobo Suspend: END! (WakeUp count: $(cat /sys/power/wakeup_count))"

Loading…
Cancel
Save