Skip to content

Commit 25fb5f4

Browse files
Wer-Wolfij-intel
authored andcommitted
platform/x86: asus-wmi: Ignore return value when writing thermal policy
On some machines like the ASUS Vivobook S14 writing the thermal policy returns the currently writen thermal policy instead of an error code. Ignore the return code to avoid falsely returning an error when the thermal policy was written successfully. Reported-by: [email protected] Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219517 Fixes: 2daa86e ("platform/x86: asus_wmi: Support throttle thermal policy") Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 3510398 commit 25fb5f4

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/platform/x86/asus-wmi.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,7 +3696,6 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus)
36963696
/* Throttle thermal policy ****************************************************/
36973697
static int throttle_thermal_policy_write(struct asus_wmi *asus)
36983698
{
3699-
u32 retval;
37003699
u8 value;
37013700
int err;
37023701

@@ -3718,8 +3717,8 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
37183717
value = asus->throttle_thermal_policy_mode;
37193718
}
37203719

3721-
err = asus_wmi_set_devstate(asus->throttle_thermal_policy_dev,
3722-
value, &retval);
3720+
/* Some machines do not return an error code as a result, so we ignore it */
3721+
err = asus_wmi_set_devstate(asus->throttle_thermal_policy_dev, value, NULL);
37233722

37243723
sysfs_notify(&asus->platform_device->dev.kobj, NULL,
37253724
"throttle_thermal_policy");
@@ -3729,12 +3728,6 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
37293728
return err;
37303729
}
37313730

3732-
if (retval != 1) {
3733-
pr_warn("Failed to set throttle thermal policy (retval): 0x%x\n",
3734-
retval);
3735-
return -EIO;
3736-
}
3737-
37383731
/* Must set to disabled if mode is toggled */
37393732
if (asus->cpu_fan_curve_available)
37403733
asus->custom_fan_curves[FAN_CURVE_DEV_CPU].enabled = false;

0 commit comments

Comments
 (0)