]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86: asus-wmi: Fix thermal profile initialization
authorArmin Wolf <W_Armin@gmx.de>
Fri, 25 Oct 2024 19:15:13 +0000 (21:15 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 26 Oct 2024 11:03:10 +0000 (13:03 +0200)
When support for vivobook fan profiles was added, the initial
call to throttle_thermal_policy_set_default() was removed, which
however is necessary for full initialization.

Fix this by calling throttle_thermal_policy_set_default() again
when setting up the platform profile.

Fixes: bcbfcebda2cb ("platform/x86: asus-wmi: add support for vivobook fan profiles")
Reported-by: Michael Larabel <Michael@phoronix.com>
Closes: https://www.phoronix.com/review/lunar-lake-xe2/5
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241025191514.15032-2-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/asus-wmi.c

index 7a48220b4f5a66f4d188af4fdfb5301a8f902f41..abdca3f05c5c15b99450414256d6e30ff5c0eaf9 100644 (file)
@@ -3908,6 +3908,16 @@ static int platform_profile_setup(struct asus_wmi *asus)
        if (!asus->throttle_thermal_policy_dev)
                return 0;
 
+       /*
+        * We need to set the default thermal profile during probe or otherwise
+        * the system will often remain in silent mode, causing low performance.
+        */
+       err = throttle_thermal_policy_set_default(asus);
+       if (err < 0) {
+               pr_warn("Failed to set default thermal profile\n");
+               return err;
+       }
+
        dev_info(dev, "Using throttle_thermal_policy for platform_profile support\n");
 
        asus->platform_profile_handler.profile_get = asus_wmi_platform_profile_get;