Commit 8843f405 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power management fixes from Rafael Wysocki:
 "These fix a few issues related to running intel_pstate in the passive
  mode with HWP enabled, correct the handling of the max_cstate module
  parameter in intel_idle and make a few janitorial changes.

  Specifics:

   - Modify Kconfig to prevent configuring either the "conservative" or
     the "ondemand" governor as the default cpufreq governor if
     intel_pstate is selected, in which case "schedutil" is the default
     choice for the default governor setting (Rafael Wysocki).

   - Modify the cpufreq core, intel_pstate and the schedutil governor to
     avoid missing updates of the HWP max limit when intel_pstate
     operates in the passive mode with HWP enabled (Rafael Wysocki).

   - Fix max_cstate module parameter handling in intel_idle for
     processor models with C-state tables coming from ACPI (Chen Yu).

   - Clean up assorted pieces of power management code (Jackie Zamow,
     Tom Rix, Zhang Qilong)"

* tag 'pm-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: schedutil: Always call driver if CPUFREQ_NEED_UPDATE_LIMITS is set
  cpufreq: Introduce cpufreq_driver_test_flags()
  cpufreq: speedstep: remove unneeded semicolon
  PM: sleep: fix typo in kernel/power/process.c
  intel_idle: Fix max_cstate for processor models without C-state tables
  cpufreq: intel_pstate: Avoid missing HWP max updates in passive mode
  cpufreq: Introduce CPUFREQ_NEED_UPDATE_LIMITS driver flag
  cpufreq: Avoid configuring old governors as default with intel_pstate
  cpufreq: e_powersaver: remove unreachable break
parents 88098fd6 dea47cf4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ config CPU_FREQ_DEFAULT_GOV_USERSPACE

config CPU_FREQ_DEFAULT_GOV_ONDEMAND
	bool "ondemand"
	depends on !(X86_INTEL_PSTATE && SMP)
	select CPU_FREQ_GOV_ONDEMAND
	select CPU_FREQ_GOV_PERFORMANCE
	help
@@ -83,6 +84,7 @@ config CPU_FREQ_DEFAULT_GOV_ONDEMAND

config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
	bool "conservative"
	depends on !(X86_INTEL_PSTATE && SMP)
	select CPU_FREQ_GOV_CONSERVATIVE
	select CPU_FREQ_GOV_PERFORMANCE
	help
+14 −1
Original line number Diff line number Diff line
@@ -1907,6 +1907,18 @@ void cpufreq_resume(void)
	}
}

/**
 * cpufreq_driver_test_flags - Test cpufreq driver's flags against given ones.
 * @flags: Flags to test against the current cpufreq driver's flags.
 *
 * Assumes that the driver is there, so callers must ensure that this is the
 * case.
 */
bool cpufreq_driver_test_flags(u16 flags)
{
	return !!(cpufreq_driver->flags & flags);
}

/**
 *	cpufreq_get_current_driver - return current driver's name
 *
@@ -2187,7 +2199,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
	 * exactly same freq is called again and so we can save on few function
	 * calls.
	 */
	if (target_freq == policy->cur)
	if (target_freq == policy->cur &&
	    !(cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS))
		return 0;

	/* Save last value to restore later on errors */
+0 −1
Original line number Diff line number Diff line
@@ -223,7 +223,6 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
	case EPS_BRAND_C3:
		pr_cont("C3\n");
		return -ENODEV;
		break;
	}
	/* Enable Enhanced PowerSaver */
	rdmsrl(MSR_IA32_MISC_ENABLE, val);
+6 −7
Original line number Diff line number Diff line
@@ -2568,14 +2568,12 @@ static int intel_cpufreq_update_pstate(struct cpudata *cpu, int target_pstate,
	int old_pstate = cpu->pstate.current_pstate;

	target_pstate = intel_pstate_prepare_request(cpu, target_pstate);
	if (target_pstate != old_pstate) {
	if (hwp_active) {
		intel_cpufreq_adjust_hwp(cpu, target_pstate, fast_switch);
		cpu->pstate.current_pstate = target_pstate;
	} else if (target_pstate != old_pstate) {
		intel_cpufreq_adjust_perf_ctl(cpu, target_pstate, fast_switch);
		cpu->pstate.current_pstate = target_pstate;
		if (hwp_active)
			intel_cpufreq_adjust_hwp(cpu, target_pstate,
						 fast_switch);
		else
			intel_cpufreq_adjust_perf_ctl(cpu, target_pstate,
						      fast_switch);
	}

	intel_cpufreq_trace(cpu, fast_switch ? INTEL_PSTATE_TRACE_FAST_SWITCH :
@@ -3032,6 +3030,7 @@ static int __init intel_pstate_init(void)
			hwp_mode_bdw = id->driver_data;
			intel_pstate.attr = hwp_cpufreq_attrs;
			intel_cpufreq.attr = hwp_cpufreq_attrs;
			intel_cpufreq.flags |= CPUFREQ_NEED_UPDATE_LIMITS;
			if (!default_driver)
				default_driver = &intel_pstate;

+0 −1
Original line number Diff line number Diff line
@@ -593,7 +593,6 @@ static void longhaul_setup_voltagescaling(void)
		break;
	default:
		return;
		break;
	}
	if (min_vid_speed >= highest_speed)
		return;
Loading