linux/kernel/power
Steven Rostedt f42ac38c59 ftrace: disable tracing for suspend to ram
I've been painstakingly debugging the issue with suspend to ram and
ftraced. The 2.6.28 code does not have this issue, but since the mcount
recording is not going to be in 27, this must be solved for the ftrace
daemon version.

The resume from suspend to ram would reboot because it was triple
faulting. Debugging further, I found that calling the mcount function
itself was not an issue, but it would fault when it incremented
preempt_count. preempt_count is on the tasks info structure that is on the
low memory address of the task's stack.  For some reason, it could not
write to it. Resuming out of suspend to ram does quite a lot of funny
tricks to get to work, so it is not surprising at all that simply doing a
preempt_disable() would cause a fault.

Thanks to Rafael for suggesting to add a "while (1);" to find the place in
resuming that is causing the fault. I would place the loop somewhere in
the code, compile and reboot and see if it would either reboot (hit the
fault) or simply hang (hit the loop).  Doing this over and over again, I
narrowed it down that it was happening in enable_nonboot_cpus.

At this point, I found that it is easier to simply disable tracing around
the suspend code, instead of searching for the particular function that
can not handle doing a preempt_disable.

This patch disables the tracer as it suspends and reenables it on resume.

I tested this patch on my Laptop, and it can resume fine with the patch.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-27 13:54:20 -07:00
..
console.c PM/gxfb: add hook to PM console layer that allows disabling of suspend VT switch 2008-04-28 08:58:36 -07:00
disk.c Suspend-related patches for 2.6.27 2008-06-12 14:25:09 -07:00
Kconfig pm: boot time suspend selftest 2008-07-24 10:47:22 -07:00
main.c ftrace: disable tracing for suspend to ram 2008-08-27 13:54:20 -07:00
Makefile PM: Remove legacy PM 2008-04-15 03:19:07 -04:00
power.h kexec jump: save/restore device state 2008-07-26 12:00:04 -07:00
poweroff.c pm: schedule sysrq poweroff on boot cpu 2008-07-24 10:47:24 -07:00
process.c pm: fix try_to_freeze_tasks()'s use of do_div() 2008-07-24 10:47:24 -07:00
snapshot.c pm: hibernation: simplify memory bitmap 2008-07-24 10:47:23 -07:00
swap.c removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
swsusp.c Hibernation: Update messages 2008-02-01 18:30:55 -05:00
user.c snapshot: Use pm_mutex for mutual exclusion 2008-07-16 23:27:03 +02:00