Skip to content

Commit d9296a7

Browse files
committed
Merge tag 'pm-5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These fix a crash in intel_pstate during resume from suspend-to-RAM that may occur after recent changes and two resource leaks in error paths in the operating performance points (OPP) framework, add a new C-states table to intel_idle and update the cpuidle MAINTAINERS entry to cover the governors too. Specifics: - Fix recently introduced crash in the intel_pstate driver that occurs if scale-invariance is disabled during resume from suspend-to-RAM due to inconsistent changes of APERF or MPERF MSR values made by the platform firmware (Rafael Wysocki). - Fix a memory leak and add a missing clk_put() in error paths in the OPP framework (Quanyang Wang, Viresh Kumar). - Add new C-states table for SnowRidge processors to the intel_idle driver (Artem Bityutskiy). - Update the MAINTAINERS entry for cpuidle to make it clear that the governors are covered by it too (Lukas Bulwahn)" * tag 'pm-5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: intel_idle: add SnowRidge C-state table cpufreq: intel_pstate: Fix fast-switch fallback path opp: Call the missing clk_put() on error opp: fix memory leak in _allocate_opp_table MAINTAINERS: include governors into CPU IDLE TIME MANAGEMENT FRAMEWORK
2 parents eda809a + 89ecf09 commit d9296a7

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4588,7 +4588,7 @@ B: https://bugzilla.kernel.org
45884588
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
45894589
F: Documentation/admin-guide/pm/cpuidle.rst
45904590
F: Documentation/driver-api/pm/cpuidle.rst
4591-
F: drivers/cpuidle/*
4591+
F: drivers/cpuidle/
45924592
F: include/linux/cpuidle.h
45934593

45944594
CPU POWER MONITORING SUBSYSTEM

drivers/cpufreq/intel_pstate.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,6 @@ static int __init intel_pstate_init(void)
30863086
intel_pstate.attr = hwp_cpufreq_attrs;
30873087
intel_cpufreq.attr = hwp_cpufreq_attrs;
30883088
intel_cpufreq.flags |= CPUFREQ_NEED_UPDATE_LIMITS;
3089-
intel_cpufreq.fast_switch = NULL;
30903089
intel_cpufreq.adjust_perf = intel_cpufreq_adjust_perf;
30913090
if (!default_driver)
30923091
default_driver = &intel_pstate;

drivers/idle/intel_idle.c

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,39 @@ static struct cpuidle_state dnv_cstates[] __initdata = {
963963
.enter = NULL }
964964
};
965965

966+
/*
967+
* Note, depending on HW and FW revision, SnowRidge SoC may or may not support
968+
* C6, and this is indicated in the CPUID mwait leaf.
969+
*/
970+
static struct cpuidle_state snr_cstates[] __initdata = {
971+
{
972+
.name = "C1",
973+
.desc = "MWAIT 0x00",
974+
.flags = MWAIT2flg(0x00),
975+
.exit_latency = 2,
976+
.target_residency = 2,
977+
.enter = &intel_idle,
978+
.enter_s2idle = intel_idle_s2idle, },
979+
{
980+
.name = "C1E",
981+
.desc = "MWAIT 0x01",
982+
.flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
983+
.exit_latency = 15,
984+
.target_residency = 25,
985+
.enter = &intel_idle,
986+
.enter_s2idle = intel_idle_s2idle, },
987+
{
988+
.name = "C6",
989+
.desc = "MWAIT 0x20",
990+
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
991+
.exit_latency = 130,
992+
.target_residency = 500,
993+
.enter = &intel_idle,
994+
.enter_s2idle = intel_idle_s2idle, },
995+
{
996+
.enter = NULL }
997+
};
998+
966999
static const struct idle_cpu idle_cpu_nehalem __initconst = {
9671000
.state_table = nehalem_cstates,
9681001
.auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE,
@@ -1084,6 +1117,12 @@ static const struct idle_cpu idle_cpu_dnv __initconst = {
10841117
.use_acpi = true,
10851118
};
10861119

1120+
static const struct idle_cpu idle_cpu_snr __initconst = {
1121+
.state_table = snr_cstates,
1122+
.disable_promotion_to_c1e = true,
1123+
.use_acpi = true,
1124+
};
1125+
10871126
static const struct x86_cpu_id intel_idle_ids[] __initconst = {
10881127
X86_MATCH_INTEL_FAM6_MODEL(NEHALEM_EP, &idle_cpu_nhx),
10891128
X86_MATCH_INTEL_FAM6_MODEL(NEHALEM, &idle_cpu_nehalem),
@@ -1122,7 +1161,7 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
11221161
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT, &idle_cpu_bxt),
11231162
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_PLUS, &idle_cpu_bxt),
11241163
X86_MATCH_INTEL_FAM6_MODEL(ATOM_GOLDMONT_D, &idle_cpu_dnv),
1125-
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &idle_cpu_dnv),
1164+
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &idle_cpu_snr),
11261165
{}
11271166
};
11281167

drivers/opp/core.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
10921092
if (IS_ERR(opp_table->clk)) {
10931093
ret = PTR_ERR(opp_table->clk);
10941094
if (ret == -EPROBE_DEFER)
1095-
goto err;
1095+
goto remove_opp_dev;
10961096

10971097
dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret);
10981098
}
@@ -1101,7 +1101,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
11011101
ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
11021102
if (ret) {
11031103
if (ret == -EPROBE_DEFER)
1104-
goto err;
1104+
goto put_clk;
11051105

11061106
dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
11071107
__func__, ret);
@@ -1113,6 +1113,11 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
11131113

11141114
return opp_table;
11151115

1116+
put_clk:
1117+
if (!IS_ERR(opp_table->clk))
1118+
clk_put(opp_table->clk);
1119+
remove_opp_dev:
1120+
_remove_opp_dev(opp_dev, opp_table);
11161121
err:
11171122
kfree(opp_table);
11181123
return ERR_PTR(ret);

0 commit comments

Comments
 (0)