Skip to content

Commit 0cac73e

Browse files
committed
Merge tag 'pm-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fix from Rafael Wysocki: "Restore the behavior of the no_turbo sysfs attribute in the intel_pstate driver which allowed users to make the driver start using turbo P-states if they have been enabled on the fly by the firmware after OS initialization (Rafael Wysocki)" * tag 'pm-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: intel_pstate: Check turbo_is_disabled() in store_no_turbo()
2 parents 94df82f + 350cbb5 commit 0cac73e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,12 +1302,17 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b,
13021302

13031303
no_turbo = !!clamp_t(int, input, 0, 1);
13041304

1305-
if (no_turbo == global.no_turbo)
1306-
goto unlock_driver;
1307-
1308-
if (global.turbo_disabled) {
1309-
pr_notice_once("Turbo disabled by BIOS or unavailable on processor\n");
1305+
WRITE_ONCE(global.turbo_disabled, turbo_is_disabled());
1306+
if (global.turbo_disabled && !no_turbo) {
1307+
pr_notice("Turbo disabled by BIOS or unavailable on processor\n");
13101308
count = -EPERM;
1309+
if (global.no_turbo)
1310+
goto unlock_driver;
1311+
else
1312+
no_turbo = 1;
1313+
}
1314+
1315+
if (no_turbo == global.no_turbo) {
13111316
goto unlock_driver;
13121317
}
13131318

@@ -1762,7 +1767,7 @@ static u64 atom_get_val(struct cpudata *cpudata, int pstate)
17621767
u32 vid;
17631768

17641769
val = (u64)pstate << 8;
1765-
if (READ_ONCE(global.no_turbo) && !global.turbo_disabled)
1770+
if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
17661771
val |= (u64)1 << 32;
17671772

17681773
vid_fp = cpudata->vid.min + mul_fp(
@@ -1927,7 +1932,7 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate)
19271932
u64 val;
19281933

19291934
val = (u64)pstate << 8;
1930-
if (READ_ONCE(global.no_turbo) && !global.turbo_disabled)
1935+
if (READ_ONCE(global.no_turbo) && !READ_ONCE(global.turbo_disabled))
19311936
val |= (u64)1 << 32;
19321937

19331938
return val;

0 commit comments

Comments
 (0)