|
@@ -1108,7 +1108,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
|
|
|
limits = &powersave_limits;
|
|
|
limits->min_policy_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
|
|
|
limits->min_policy_pct = clamp_t(int, limits->min_policy_pct, 0 , 100);
|
|
|
- limits->max_policy_pct = (policy->max * 100) / policy->cpuinfo.max_freq;
|
|
|
+ limits->max_policy_pct = DIV_ROUND_UP(policy->max * 100,
|
|
|
+ policy->cpuinfo.max_freq);
|
|
|
limits->max_policy_pct = clamp_t(int, limits->max_policy_pct, 0 , 100);
|
|
|
|
|
|
/* Normalize user input to [min_policy_pct, max_policy_pct] */
|