* [Bug 83151] New: Intel Turbo can't be disabled/enabled under certain condictions
@ 2014-08-24 19:26 bugzilla-daemon
2014-08-25 11:35 ` [Bug 83151] " bugzilla-daemon
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: bugzilla-daemon @ 2014-08-24 19:26 UTC (permalink / raw)
To: cpufreq
https://bugzilla.kernel.org/show_bug.cgi?id=83151
Bug ID: 83151
Summary: Intel Turbo can't be disabled/enabled under certain
condictions
Product: Power Management
Version: 2.5
Kernel Version: 3.16
Hardware: x86-64
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: cpufreq
Assignee: cpufreq@vger.kernel.org
Reporter: gabriele.mzt@gmail.com
Regression: No
On my laptop (Dell XPS 13 9333) MSR_IA32_MISC_ENABLE_TURBO_DISABLE is 0 when AC
is present, 1 otherwise.
Because of this, setting turbo_disabled on init leads to some issues:
* If I turn on the laptop while the AC is present, the sysfs interface always
allows me to change the state of no_turbo. However, the changes are only
effective when the AC is present.
* If I turn on the laptop while on battery, the sysfs interface doesn't allow
me to change the state of no_turbo. That means I'm not able to disable it when
it's automatically enabled when I plug the AC.
Note that I don't have the possibility to disable Intel Turbo from the BIOS
settings.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug 83151] Intel Turbo can't be disabled/enabled under certain condictions
2014-08-24 19:26 [Bug 83151] New: Intel Turbo can't be disabled/enabled under certain condictions bugzilla-daemon
@ 2014-08-25 11:35 ` bugzilla-daemon
2014-08-27 17:24 ` bugzilla-daemon
2014-08-28 5:04 ` bugzilla-daemon
2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2014-08-25 11:35 UTC (permalink / raw)
To: cpufreq
https://bugzilla.kernel.org/show_bug.cgi?id=83151
--- Comment #1 from Gabriele Mazzotta <gabriele.mzt@gmail.com> ---
I also noticed that because of the changes of the turbo state not expected by
intel_pstate, max_perf is sometimes wrong.
The patch should fix my problem. I don't know if there's a way to avoid
reading the register every time or if there's a better way to deal with my
problem.
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index c5eac94..b8adfec 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -218,6 +218,13 @@ static inline void intel_pstate_reset_all_pid(void)
}
}
+static int turbo_disabled(void) {
+ u64 misc_en;
+ rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
+ return (limits.turbo_disabled ||
+ (misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE));
+}
+
/************************** debugfs begin ************************/
static int pid_param_set(void *data, u64 val)
{
@@ -284,10 +291,8 @@ static ssize_t store_no_turbo(struct kobject *a, struct
attribute *b,
if (ret != 1)
return -EINVAL;
limits.no_turbo = clamp_t(int, input, 0 , 1);
- if (limits.turbo_disabled) {
+ if (turbo_disabled())
pr_warn("Turbo disabled by BIOS or unavailable on processor\n");
- limits.no_turbo = limits.turbo_disabled;
- }
return count;
}
@@ -323,6 +328,12 @@ static ssize_t store_min_perf_pct(struct kobject *a,
struct attribute *b,
return count;
}
+static ssize_t show_actual_no_turbo(struct kobject *kobj,
+ struct attribute *attr, char *buf)
+{
+ return sprintf(buf, "%u\n", limits.no_turbo || turbo_disabled());
+}
+
show_one(no_turbo, no_turbo);
show_one(max_perf_pct, max_perf_pct);
show_one(min_perf_pct, min_perf_pct);
@@ -330,11 +341,13 @@ show_one(min_perf_pct, min_perf_pct);
define_one_global_rw(no_turbo);
define_one_global_rw(max_perf_pct);
define_one_global_rw(min_perf_pct);
+define_one_global_ro(actual_no_turbo);
static struct attribute *intel_pstate_attributes[] = {
&no_turbo.attr,
&max_perf_pct.attr,
&min_perf_pct.attr,
+ &actual_no_turbo.attr,
NULL
};
@@ -386,7 +399,7 @@ static void byt_set_pstate(struct cpudata *cpudata, int
pstate)
u32 vid;
val = pstate << 8;
- if (limits.no_turbo && !limits.turbo_disabled)
+ if (limits.no_turbo && !turbo_disabled())
val |= (u64)1 << 32;
vid_fp = cpudata->vid.min + mul_fp(
@@ -454,7 +467,7 @@ static void core_set_pstate(struct cpudata *cpudata, int
pstate)
u64 val;
val = pstate << 8;
- if (limits.no_turbo && !limits.turbo_disabled)
+ if (limits.no_turbo && !turbo_disabled())
val |= (u64)1 << 32;
wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val);
@@ -501,7 +514,7 @@ static void intel_pstate_get_min_max(struct cpudata *cpu,
int *min, int *max)
int max_perf_adj;
int min_perf;
- if (limits.no_turbo)
+ if (limits.no_turbo || turbo_disabled())
max_perf = cpu->pstate.max_pstate;
max_perf_adj = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf));
@@ -719,7 +732,6 @@ static int intel_pstate_set_policy(struct cpufreq_policy
*policy)
limits.min_perf = int_tofp(1);
limits.max_perf_pct = 100;
limits.max_perf = int_tofp(1);
- limits.no_turbo = limits.turbo_disabled;
return 0;
}
limits.min_perf_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
@@ -762,7 +774,6 @@ static int intel_pstate_cpu_init(struct cpufreq_policy
*policy)
{
struct cpudata *cpu;
int rc;
- u64 misc_en;
rc = intel_pstate_init_cpu(policy->cpu);
if (rc)
@@ -770,12 +781,8 @@ static int intel_pstate_cpu_init(struct cpufreq_policy
*policy)
cpu = all_cpu_data[policy->cpu];
- rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
- if (misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ||
- cpu->pstate.max_pstate == cpu->pstate.turbo_pstate) {
+ if (cpu->pstate.max_pstate == cpu->pstate.turbo_pstate)
limits.turbo_disabled = 1;
- limits.no_turbo = 1;
- }
if (limits.min_perf_pct == 100 && limits.max_perf_pct == 100)
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
else
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Bug 83151] Intel Turbo can't be disabled/enabled under certain condictions
2014-08-24 19:26 [Bug 83151] New: Intel Turbo can't be disabled/enabled under certain condictions bugzilla-daemon
2014-08-25 11:35 ` [Bug 83151] " bugzilla-daemon
@ 2014-08-27 17:24 ` bugzilla-daemon
2014-08-28 5:04 ` bugzilla-daemon
2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2014-08-27 17:24 UTC (permalink / raw)
To: cpufreq
https://bugzilla.kernel.org/show_bug.cgi?id=83151
Dirk Brandewie <dirk.brandewie@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dirk.brandewie@gmail.com
--- Comment #2 from Dirk Brandewie <dirk.brandewie@gmail.com> ---
I am just back from vacation give me a couple of days to dig out of the inbox
to review/test
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug 83151] Intel Turbo can't be disabled/enabled under certain condictions
2014-08-24 19:26 [Bug 83151] New: Intel Turbo can't be disabled/enabled under certain condictions bugzilla-daemon
2014-08-25 11:35 ` [Bug 83151] " bugzilla-daemon
2014-08-27 17:24 ` bugzilla-daemon
@ 2014-08-28 5:04 ` bugzilla-daemon
2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2014-08-28 5:04 UTC (permalink / raw)
To: cpufreq
https://bugzilla.kernel.org/show_bug.cgi?id=83151
Lan Tianyu <tianyu.lan@intel.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |tianyu.lan@intel.com
Assignee|cpufreq@vger.kernel.org |dirk.brandewie@gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-28 5:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-24 19:26 [Bug 83151] New: Intel Turbo can't be disabled/enabled under certain condictions bugzilla-daemon
2014-08-25 11:35 ` [Bug 83151] " bugzilla-daemon
2014-08-27 17:24 ` bugzilla-daemon
2014-08-28 5:04 ` bugzilla-daemon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).