diff options
| author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2012-06-16 09:30:45 -0400 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2012-08-13 09:10:34 -0400 |
| commit | bd2ae50a2a22701606ea0ebe6e5013a64b25b992 (patch) | |
| tree | 29629911bd88cfd9d309112f9c7d6bdfe0d1e966 /kernel | |
| parent | 8510f6dffecfc001d81f4fb7e1b8d535d6e7c2f9 (diff) | |
ftrace: Disable function tracing during suspend/resume and hibernation, again
BugLink: http://bugs.launchpad.net/bugs/1034988
commit 443772d408a25af62498793f6f805ce3c559309a upstream.
If function tracing is enabled for some of the low-level suspend/resume
functions, it leads to triple fault during resume from suspend, ultimately
ending up in a reboot instead of a resume (or a total refusal to come out
of suspended state, on some machines).
This issue was explained in more detail in commit f42ac38c59e0a03d (ftrace:
disable tracing for suspend to ram). However, the changes made by that commit
got reverted by commit cbe2f5a6e84eebb (tracing: allow tracing of
suspend/resume & hibernation code again). So, unfortunately since things are
not yet robust enough to allow tracing of low-level suspend/resume functions,
suspend/resume is still broken when ftrace is enabled.
So fix this by disabling function tracing during suspend/resume & hibernation.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/power/hibernate.c | 6 | ||||
| -rw-r--r-- | kernel/power/suspend.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 8884c27682f..32f1590644d 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
| @@ -344,6 +344,7 @@ int hibernation_snapshot(int platform_mode) | |||
| 344 | goto Complete_devices; | 344 | goto Complete_devices; |
| 345 | 345 | ||
| 346 | suspend_console(); | 346 | suspend_console(); |
| 347 | ftrace_stop(); | ||
| 347 | pm_restrict_gfp_mask(); | 348 | pm_restrict_gfp_mask(); |
| 348 | error = dpm_suspend(PMSG_FREEZE); | 349 | error = dpm_suspend(PMSG_FREEZE); |
| 349 | if (error) | 350 | if (error) |
| @@ -369,6 +370,7 @@ int hibernation_snapshot(int platform_mode) | |||
| 369 | if (error || !in_suspend) | 370 | if (error || !in_suspend) |
| 370 | pm_restore_gfp_mask(); | 371 | pm_restore_gfp_mask(); |
| 371 | 372 | ||
| 373 | ftrace_start(); | ||
| 372 | resume_console(); | 374 | resume_console(); |
| 373 | 375 | ||
| 374 | Complete_devices: | 376 | Complete_devices: |
| @@ -471,6 +473,7 @@ int hibernation_restore(int platform_mode) | |||
| 471 | 473 | ||
| 472 | pm_prepare_console(); | 474 | pm_prepare_console(); |
| 473 | suspend_console(); | 475 | suspend_console(); |
| 476 | ftrace_stop(); | ||
| 474 | pm_restrict_gfp_mask(); | 477 | pm_restrict_gfp_mask(); |
| 475 | error = dpm_suspend_start(PMSG_QUIESCE); | 478 | error = dpm_suspend_start(PMSG_QUIESCE); |
| 476 | if (!error) { | 479 | if (!error) { |
| @@ -478,6 +481,7 @@ int hibernation_restore(int platform_mode) | |||
| 478 | dpm_resume_end(PMSG_RECOVER); | 481 | dpm_resume_end(PMSG_RECOVER); |
| 479 | } | 482 | } |
| 480 | pm_restore_gfp_mask(); | 483 | pm_restore_gfp_mask(); |
| 484 | ftrace_start(); | ||
| 481 | resume_console(); | 485 | resume_console(); |
| 482 | pm_restore_console(); | 486 | pm_restore_console(); |
| 483 | return error; | 487 | return error; |
| @@ -504,6 +508,7 @@ int hibernation_platform_enter(void) | |||
| 504 | 508 | ||
| 505 | entering_platform_hibernation = true; | 509 | entering_platform_hibernation = true; |
| 506 | suspend_console(); | 510 | suspend_console(); |
| 511 | ftrace_stop(); | ||
| 507 | error = dpm_suspend_start(PMSG_HIBERNATE); | 512 | error = dpm_suspend_start(PMSG_HIBERNATE); |
| 508 | if (error) { | 513 | if (error) { |
| 509 | if (hibernation_ops->recover) | 514 | if (hibernation_ops->recover) |
| @@ -547,6 +552,7 @@ int hibernation_platform_enter(void) | |||
| 547 | Resume_devices: | 552 | Resume_devices: |
| 548 | entering_platform_hibernation = false; | 553 | entering_platform_hibernation = false; |
| 549 | dpm_resume_end(PMSG_RESTORE); | 554 | dpm_resume_end(PMSG_RESTORE); |
| 555 | ftrace_start(); | ||
| 550 | resume_console(); | 556 | resume_console(); |
| 551 | 557 | ||
| 552 | Close: | 558 | Close: |
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 449ccc9c0a4..e40d20595b1 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 24 | #include <linux/suspend.h> | 24 | #include <linux/suspend.h> |
| 25 | #include <linux/syscore_ops.h> | 25 | #include <linux/syscore_ops.h> |
| 26 | #include <linux/ftrace.h> | ||
| 26 | #include <trace/events/power.h> | 27 | #include <trace/events/power.h> |
| 27 | 28 | ||
| 28 | #include "power.h" | 29 | #include "power.h" |
| @@ -210,6 +211,7 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
| 210 | goto Close; | 211 | goto Close; |
| 211 | } | 212 | } |
| 212 | suspend_console(); | 213 | suspend_console(); |
| 214 | ftrace_stop(); | ||
| 213 | suspend_test_start(); | 215 | suspend_test_start(); |
| 214 | error = dpm_suspend_start(PMSG_SUSPEND); | 216 | error = dpm_suspend_start(PMSG_SUSPEND); |
| 215 | if (error) { | 217 | if (error) { |
| @@ -226,6 +228,7 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
| 226 | suspend_test_start(); | 228 | suspend_test_start(); |
| 227 | dpm_resume_end(PMSG_RESUME); | 229 | dpm_resume_end(PMSG_RESUME); |
| 228 | suspend_test_finish("resume devices"); | 230 | suspend_test_finish("resume devices"); |
| 231 | ftrace_start(); | ||
| 229 | resume_console(); | 232 | resume_console(); |
| 230 | Close: | 233 | Close: |
| 231 | if (suspend_ops->end) | 234 | if (suspend_ops->end) |
