Commit a79a588f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power management fixes from Rafael Wysocki:
 "These address system suspend failures under memory pressure in some
  configurations, fix up RAPL handling on platforms where PL1 cannot be
  disabled, and fix a documentation typo:

   - Prevent the Intel RAPL power capping driver from allowing PL1 to be
     exceeded by mistake on systems when PL1 cannot be disabled (Zhang
     Rui)

   - Fix a 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)"

* tag 'pm-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM: sleep: docs: Replace "diasble" with "disable"
  powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed
  PM: Restrict swap use to later in the suspend sequence
parents 49dcc4f6 250d0579
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;
+17 −1
Original line number Diff line number Diff line
@@ -341,12 +341,28 @@ static int set_domain_enable(struct powercap_zone *power_zone, bool mode)
{
	struct rapl_domain *rd = power_zone_to_rapl_domain(power_zone);
	struct rapl_defaults *defaults = get_defaults(rd->rp);
	u64 val;
	int ret;

	cpus_read_lock();
	ret = rapl_write_pl_data(rd, POWER_LIMIT1, PL_ENABLE, mode);
	if (!ret && defaults->set_floor_freq)
	if (ret)
		goto end;

	ret = rapl_read_pl_data(rd, POWER_LIMIT1, PL_ENABLE, false, &val);
	if (ret)
		goto end;

	if (mode != val) {
		pr_debug("%s cannot be %s\n", power_zone->name,
			 str_enabled_disabled(mode));
		goto end;
	}

	if (defaults->set_floor_freq)
		defaults->set_floor_freq(rd, mode);

end:
	cpus_read_unlock();

	return ret;
+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:
Loading