Commit 250d0579 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-sleep'

Merge fixes related to system sleep for 6.16-rc5:

 - Fix typo in the ABI documentation (Sumanth Gavini).

 - Allow swap to be used a bit longer during system suspend and
   hibernation to avoid suspend failures under memory pressure (Mario
   Limonciello).

* pm-sleep:
  PM: sleep: docs: Replace "diasble" with "disable"
  PM: Restrict swap use to later in the suspend sequence
parents 96420920 3e7e5adc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ Date: January 2009
Contact:	Rafael J. Wysocki <rjw@rjwysocki.net>
Description:
		The /sys/devices/.../async attribute allows the user space to
		enable or diasble the device's suspend and resume callbacks to
		enable or disable the device's suspend and resume callbacks to
		be executed asynchronously (ie. in separate threads, in parallel
		with the main suspend/resume thread) during system-wide power
		transitions (eg. suspend to RAM, hibernation).
+4 −1
Original line number Diff line number Diff line
@@ -1236,6 +1236,7 @@ void dpm_complete(pm_message_t state)
 */
void dpm_resume_end(pm_message_t state)
{
	pm_restore_gfp_mask();
	dpm_resume(state);
	dpm_complete(state);
}
@@ -2176,8 +2177,10 @@ int dpm_suspend_start(pm_message_t state)
	error = dpm_prepare(state);
	if (error)
		dpm_save_failed_step(SUSPEND_PREPARE);
	else
	else {
		pm_restrict_gfp_mask();
		error = dpm_suspend(state);
	}

	dpm_show_time(starttime, state, error, "start");
	return error;
+5 −0
Original line number Diff line number Diff line
@@ -446,6 +446,8 @@ extern int unregister_pm_notifier(struct notifier_block *nb);
extern void ksys_sync_helper(void);
extern void pm_report_hw_sleep_time(u64 t);
extern void pm_report_max_hw_sleep(u64 t);
void pm_restrict_gfp_mask(void);
void pm_restore_gfp_mask(void);

#define pm_notifier(fn, pri) {				\
	static struct notifier_block fn##_nb =			\
@@ -492,6 +494,9 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
static inline void pm_report_hw_sleep_time(u64 t) {};
static inline void pm_report_max_hw_sleep(u64 t) {};

static inline void pm_restrict_gfp_mask(void) {}
static inline void pm_restore_gfp_mask(void) {}

static inline void ksys_sync_helper(void) {}

#define pm_notifier(fn, pri)	do { (void)(fn); } while (0)
+1 −0
Original line number Diff line number Diff line
@@ -1136,6 +1136,7 @@ int kernel_kexec(void)
 Resume_devices:
		dpm_resume_end(PMSG_RESTORE);
 Resume_console:
		pm_restore_gfp_mask();
		console_resume_all();
		thaw_processes();
 Restore_console:
+0 −3
Original line number Diff line number Diff line
@@ -423,7 +423,6 @@ int hibernation_snapshot(int platform_mode)
	}

	console_suspend_all();
	pm_restrict_gfp_mask();

	error = dpm_suspend(PMSG_FREEZE);

@@ -559,7 +558,6 @@ int hibernation_restore(int platform_mode)

	pm_prepare_console();
	console_suspend_all();
	pm_restrict_gfp_mask();
	error = dpm_suspend_start(PMSG_QUIESCE);
	if (!error) {
		error = resume_target_kernel(platform_mode);
@@ -571,7 +569,6 @@ int hibernation_restore(int platform_mode)
		BUG_ON(!error);
	}
	dpm_resume_end(PMSG_RECOVER);
	pm_restore_gfp_mask();
	console_resume_all();
	pm_restore_console();
	return error;
Loading