Skip to content

Commit 9c2b23a

Browse files
committed
Merge tag 'thermal-7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fix from Rafael Wysocki: "This prevents the int340x thermal driver from taking the power slider offset parameter into account incorrectly in some cases (Srinivas Pandruvada)" * tag 'thermal-7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: intel: int340x: soc_slider: Set offset only for balanced mode
2 parents 2d74bd3 + 7dfe984 commit 9c2b23a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,21 @@ static inline void write_soc_slider(struct proc_thermal_device *proc_priv, u64 v
176176

177177
static void set_soc_power_profile(struct proc_thermal_device *proc_priv, int slider)
178178
{
179+
u8 offset;
179180
u64 val;
180181

181182
val = read_soc_slider(proc_priv);
182183
val &= ~SLIDER_MASK;
183184
val |= FIELD_PREP(SLIDER_MASK, slider) | BIT(SLIDER_ENABLE_BIT);
184185

186+
if (slider == SOC_SLIDER_VALUE_MINIMUM || slider == SOC_SLIDER_VALUE_MAXIMUM)
187+
offset = 0;
188+
else
189+
offset = slider_offset;
190+
185191
/* Set the slider offset from module params */
186192
val &= ~SLIDER_OFFSET_MASK;
187-
val |= FIELD_PREP(SLIDER_OFFSET_MASK, slider_offset);
193+
val |= FIELD_PREP(SLIDER_OFFSET_MASK, offset);
188194

189195
write_soc_slider(proc_priv, val);
190196
}

0 commit comments

Comments
 (0)