summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch113
1 files changed, 113 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch
new file mode 100644
index 00000000..3ec5202b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0030-ftrace-Disable-function-tracing-during-suspend-resum.patch
@@ -0,0 +1,113 @@
1From 951ac5885b5a314d394ea0668dedccd7ed9216e5 Mon Sep 17 00:00:00 2001
2From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
3Date: Sat, 16 Jun 2012 15:30:45 +0200
4Subject: [PATCH 30/73] ftrace: Disable function tracing during suspend/resume
5 and hibernation, again
6
7commit 443772d408a25af62498793f6f805ce3c559309a upstream.
8
9If function tracing is enabled for some of the low-level suspend/resume
10functions, it leads to triple fault during resume from suspend, ultimately
11ending up in a reboot instead of a resume (or a total refusal to come out
12of suspended state, on some machines).
13
14This issue was explained in more detail in commit f42ac38c59e0a03d (ftrace:
15disable tracing for suspend to ram). However, the changes made by that commit
16got reverted by commit cbe2f5a6e84eebb (tracing: allow tracing of
17suspend/resume & hibernation code again). So, unfortunately since things are
18not yet robust enough to allow tracing of low-level suspend/resume functions,
19suspend/resume is still broken when ftrace is enabled.
20
21So fix this by disabling function tracing during suspend/resume & hibernation.
22
23Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
24Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
25Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
26---
27 kernel/power/hibernate.c | 6 ++++++
28 kernel/power/suspend.c | 3 +++
29 2 files changed, 9 insertions(+), 0 deletions(-)
30
31diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
32index 7c0d578..013bd2e 100644
33--- a/kernel/power/hibernate.c
34+++ b/kernel/power/hibernate.c
35@@ -367,6 +367,7 @@ int hibernation_snapshot(int platform_mode)
36 }
37
38 suspend_console();
39+ ftrace_stop();
40 pm_restrict_gfp_mask();
41 error = dpm_suspend(PMSG_FREEZE);
42 if (error)
43@@ -392,6 +393,7 @@ int hibernation_snapshot(int platform_mode)
44 if (error || !in_suspend)
45 pm_restore_gfp_mask();
46
47+ ftrace_start();
48 resume_console();
49 dpm_complete(msg);
50
51@@ -496,6 +498,7 @@ int hibernation_restore(int platform_mode)
52
53 pm_prepare_console();
54 suspend_console();
55+ ftrace_stop();
56 pm_restrict_gfp_mask();
57 error = dpm_suspend_start(PMSG_QUIESCE);
58 if (!error) {
59@@ -503,6 +506,7 @@ int hibernation_restore(int platform_mode)
60 dpm_resume_end(PMSG_RECOVER);
61 }
62 pm_restore_gfp_mask();
63+ ftrace_start();
64 resume_console();
65 pm_restore_console();
66 return error;
67@@ -529,6 +533,7 @@ int hibernation_platform_enter(void)
68
69 entering_platform_hibernation = true;
70 suspend_console();
71+ ftrace_stop();
72 error = dpm_suspend_start(PMSG_HIBERNATE);
73 if (error) {
74 if (hibernation_ops->recover)
75@@ -572,6 +577,7 @@ int hibernation_platform_enter(void)
76 Resume_devices:
77 entering_platform_hibernation = false;
78 dpm_resume_end(PMSG_RESTORE);
79+ ftrace_start();
80 resume_console();
81
82 Close:
83diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
84index 4953dc0..af48faa 100644
85--- a/kernel/power/suspend.c
86+++ b/kernel/power/suspend.c
87@@ -25,6 +25,7 @@
88 #include <linux/export.h>
89 #include <linux/suspend.h>
90 #include <linux/syscore_ops.h>
91+#include <linux/ftrace.h>
92 #include <trace/events/power.h>
93
94 #include "power.h"
95@@ -220,6 +221,7 @@ int suspend_devices_and_enter(suspend_state_t state)
96 goto Close;
97 }
98 suspend_console();
99+ ftrace_stop();
100 suspend_test_start();
101 error = dpm_suspend_start(PMSG_SUSPEND);
102 if (error) {
103@@ -239,6 +241,7 @@ int suspend_devices_and_enter(suspend_state_t state)
104 suspend_test_start();
105 dpm_resume_end(PMSG_RESUME);
106 suspend_test_finish("resume devices");
107+ ftrace_start();
108 resume_console();
109 Close:
110 if (suspend_ops->end)
111--
1121.7.7.6
113