aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2012-06-16 09:30:45 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-01 07:31:22 -0400
commit443772d408a25af62498793f6f805ce3c559309a (patch)
treef89e50547524bbb275d38b8a39b1e4d82a18c22d /kernel/power
parent62c552ccc3eda1198632a4f344aa32623d226bab (diff)
ftrace: Disable function tracing during suspend/resume and hibernation, again
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> Cc: stable@vger.kernel.org Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/hibernate.c6
-rw-r--r--kernel/power/suspend.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 21ad3fe3164f..0d4b354bc1be 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -358,6 +358,7 @@ int hibernation_snapshot(int platform_mode)
358 } 358 }
359 359
360 suspend_console(); 360 suspend_console();
361 ftrace_stop();
361 pm_restrict_gfp_mask(); 362 pm_restrict_gfp_mask();
362 363
363 error = dpm_suspend(PMSG_FREEZE); 364 error = dpm_suspend(PMSG_FREEZE);
@@ -383,6 +384,7 @@ int hibernation_snapshot(int platform_mode)
383 if (error || !in_suspend) 384 if (error || !in_suspend)
384 pm_restore_gfp_mask(); 385 pm_restore_gfp_mask();
385 386
387 ftrace_start();
386 resume_console(); 388 resume_console();
387 dpm_complete(msg); 389 dpm_complete(msg);
388 390
@@ -485,6 +487,7 @@ int hibernation_restore(int platform_mode)
485 487
486 pm_prepare_console(); 488 pm_prepare_console();
487 suspend_console(); 489 suspend_console();
490 ftrace_stop();
488 pm_restrict_gfp_mask(); 491 pm_restrict_gfp_mask();
489 error = dpm_suspend_start(PMSG_QUIESCE); 492 error = dpm_suspend_start(PMSG_QUIESCE);
490 if (!error) { 493 if (!error) {
@@ -492,6 +495,7 @@ int hibernation_restore(int platform_mode)
492 dpm_resume_end(PMSG_RECOVER); 495 dpm_resume_end(PMSG_RECOVER);
493 } 496 }
494 pm_restore_gfp_mask(); 497 pm_restore_gfp_mask();
498 ftrace_start();
495 resume_console(); 499 resume_console();
496 pm_restore_console(); 500 pm_restore_console();
497 return error; 501 return error;
@@ -518,6 +522,7 @@ int hibernation_platform_enter(void)
518 522
519 entering_platform_hibernation = true; 523 entering_platform_hibernation = true;
520 suspend_console(); 524 suspend_console();
525 ftrace_stop();
521 error = dpm_suspend_start(PMSG_HIBERNATE); 526 error = dpm_suspend_start(PMSG_HIBERNATE);
522 if (error) { 527 if (error) {
523 if (hibernation_ops->recover) 528 if (hibernation_ops->recover)
@@ -561,6 +566,7 @@ int hibernation_platform_enter(void)
561 Resume_devices: 566 Resume_devices:
562 entering_platform_hibernation = false; 567 entering_platform_hibernation = false;
563 dpm_resume_end(PMSG_RESTORE); 568 dpm_resume_end(PMSG_RESTORE);
569 ftrace_start();
564 resume_console(); 570 resume_console();
565 571
566 Close: 572 Close:
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 396d262b8fd0..c8b7446b27df 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -24,6 +24,7 @@
24#include <linux/export.h> 24#include <linux/export.h>
25#include <linux/suspend.h> 25#include <linux/suspend.h>
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27#include <linux/ftrace.h>
27#include <trace/events/power.h> 28#include <trace/events/power.h>
28 29
29#include "power.h" 30#include "power.h"
@@ -212,6 +213,7 @@ int suspend_devices_and_enter(suspend_state_t state)
212 goto Close; 213 goto Close;
213 } 214 }
214 suspend_console(); 215 suspend_console();
216 ftrace_stop();
215 suspend_test_start(); 217 suspend_test_start();
216 error = dpm_suspend_start(PMSG_SUSPEND); 218 error = dpm_suspend_start(PMSG_SUSPEND);
217 if (error) { 219 if (error) {
@@ -231,6 +233,7 @@ int suspend_devices_and_enter(suspend_state_t state)
231 suspend_test_start(); 233 suspend_test_start();
232 dpm_resume_end(PMSG_RESUME); 234 dpm_resume_end(PMSG_RESUME);
233 suspend_test_finish("resume devices"); 235 suspend_test_finish("resume devices");
236 ftrace_start();
234 resume_console(); 237 resume_console();
235 Close: 238 Close:
236 if (suspend_ops->end) 239 if (suspend_ops->end)