mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ftrace: disable tracing for hibernation
In accordance with commit f42ac38c59
("ftrace: disable tracing for suspend to ram"), disable tracing
around the suspend code in hibernation code paths.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
			
			
This commit is contained in:
		
							parent
							
								
									b09331e530
								
							
						
					
					
						commit
						41108eb101
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
					@ -21,6 +21,7 @@
 | 
				
			||||||
#include <linux/console.h>
 | 
					#include <linux/console.h>
 | 
				
			||||||
#include <linux/cpu.h>
 | 
					#include <linux/cpu.h>
 | 
				
			||||||
#include <linux/freezer.h>
 | 
					#include <linux/freezer.h>
 | 
				
			||||||
 | 
					#include <linux/ftrace.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "power.h"
 | 
					#include "power.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -255,7 +256,7 @@ static int create_image(int platform_mode)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int hibernation_snapshot(int platform_mode)
 | 
					int hibernation_snapshot(int platform_mode)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int error;
 | 
						int error, ftrace_save;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Free memory before shutting down devices. */
 | 
						/* Free memory before shutting down devices. */
 | 
				
			||||||
	error = swsusp_shrink_memory();
 | 
						error = swsusp_shrink_memory();
 | 
				
			||||||
| 
						 | 
					@ -267,6 +268,7 @@ int hibernation_snapshot(int platform_mode)
 | 
				
			||||||
		goto Close;
 | 
							goto Close;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	suspend_console();
 | 
						suspend_console();
 | 
				
			||||||
 | 
						ftrace_save = __ftrace_enabled_save();
 | 
				
			||||||
	error = device_suspend(PMSG_FREEZE);
 | 
						error = device_suspend(PMSG_FREEZE);
 | 
				
			||||||
	if (error)
 | 
						if (error)
 | 
				
			||||||
		goto Recover_platform;
 | 
							goto Recover_platform;
 | 
				
			||||||
| 
						 | 
					@ -296,6 +298,7 @@ int hibernation_snapshot(int platform_mode)
 | 
				
			||||||
 Resume_devices:
 | 
					 Resume_devices:
 | 
				
			||||||
	device_resume(in_suspend ?
 | 
						device_resume(in_suspend ?
 | 
				
			||||||
		(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
 | 
							(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
 | 
				
			||||||
 | 
						__ftrace_enabled_restore(ftrace_save);
 | 
				
			||||||
	resume_console();
 | 
						resume_console();
 | 
				
			||||||
 Close:
 | 
					 Close:
 | 
				
			||||||
	platform_end(platform_mode);
 | 
						platform_end(platform_mode);
 | 
				
			||||||
| 
						 | 
					@ -366,10 +369,11 @@ static int resume_target_kernel(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int hibernation_restore(int platform_mode)
 | 
					int hibernation_restore(int platform_mode)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int error;
 | 
						int error, ftrace_save;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pm_prepare_console();
 | 
						pm_prepare_console();
 | 
				
			||||||
	suspend_console();
 | 
						suspend_console();
 | 
				
			||||||
 | 
						ftrace_save = __ftrace_enabled_save();
 | 
				
			||||||
	error = device_suspend(PMSG_QUIESCE);
 | 
						error = device_suspend(PMSG_QUIESCE);
 | 
				
			||||||
	if (error)
 | 
						if (error)
 | 
				
			||||||
		goto Finish;
 | 
							goto Finish;
 | 
				
			||||||
| 
						 | 
					@ -384,6 +388,7 @@ int hibernation_restore(int platform_mode)
 | 
				
			||||||
	platform_restore_cleanup(platform_mode);
 | 
						platform_restore_cleanup(platform_mode);
 | 
				
			||||||
	device_resume(PMSG_RECOVER);
 | 
						device_resume(PMSG_RECOVER);
 | 
				
			||||||
 Finish:
 | 
					 Finish:
 | 
				
			||||||
 | 
						__ftrace_enabled_restore(ftrace_save);
 | 
				
			||||||
	resume_console();
 | 
						resume_console();
 | 
				
			||||||
	pm_restore_console();
 | 
						pm_restore_console();
 | 
				
			||||||
	return error;
 | 
						return error;
 | 
				
			||||||
| 
						 | 
					@ -396,7 +401,7 @@ int hibernation_restore(int platform_mode)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int hibernation_platform_enter(void)
 | 
					int hibernation_platform_enter(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int error;
 | 
						int error, ftrace_save;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!hibernation_ops)
 | 
						if (!hibernation_ops)
 | 
				
			||||||
		return -ENOSYS;
 | 
							return -ENOSYS;
 | 
				
			||||||
| 
						 | 
					@ -411,6 +416,7 @@ int hibernation_platform_enter(void)
 | 
				
			||||||
		goto Close;
 | 
							goto Close;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	suspend_console();
 | 
						suspend_console();
 | 
				
			||||||
 | 
						ftrace_save = __ftrace_enabled_save();
 | 
				
			||||||
	error = device_suspend(PMSG_HIBERNATE);
 | 
						error = device_suspend(PMSG_HIBERNATE);
 | 
				
			||||||
	if (error) {
 | 
						if (error) {
 | 
				
			||||||
		if (hibernation_ops->recover)
 | 
							if (hibernation_ops->recover)
 | 
				
			||||||
| 
						 | 
					@ -445,6 +451,7 @@ int hibernation_platform_enter(void)
 | 
				
			||||||
	hibernation_ops->finish();
 | 
						hibernation_ops->finish();
 | 
				
			||||||
 Resume_devices:
 | 
					 Resume_devices:
 | 
				
			||||||
	device_resume(PMSG_RESTORE);
 | 
						device_resume(PMSG_RESTORE);
 | 
				
			||||||
 | 
						__ftrace_enabled_restore(ftrace_save);
 | 
				
			||||||
	resume_console();
 | 
						resume_console();
 | 
				
			||||||
 Close:
 | 
					 Close:
 | 
				
			||||||
	hibernation_ops->end();
 | 
						hibernation_ops->end();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue