From: Hans de Goede <hdegoede@redhat.com>
To: Armin Wolf <W_Armin@gmx.de>,
auslands-kv@gmx.de, corentin.chary@gmail.com, luke@ljones.dev
Cc: ilpo.jarvinen@linux.intel.com,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
Date: Mon, 25 Nov 2024 10:39:59 +0100 [thread overview]
Message-ID: <13590dd6-1529-487c-842a-85b44c577811@redhat.com> (raw)
In-Reply-To: <20241124171941.29789-1-W_Armin@gmx.de>
Hi,
On 24-Nov-24 6:19 PM, Armin Wolf wrote:
> 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: auslands-kv@gmx.de
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219517
> Fixes: 2daa86e78c49 ("platform/x86: asus_wmi: Support throttle thermal policy")
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/platform/x86/asus-wmi.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index ba8b6d028f9f..8bd187e8b47f 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -3696,7 +3696,6 @@ static int asus_wmi_custom_fan_curve_init(struct asus_wmi *asus)
> /* Throttle thermal policy ****************************************************/
> static int throttle_thermal_policy_write(struct asus_wmi *asus)
> {
> - u32 retval;
> u8 value;
> int err;
>
> @@ -3718,8 +3717,8 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
> value = asus->throttle_thermal_policy_mode;
> }
>
> - err = asus_wmi_set_devstate(asus->throttle_thermal_policy_dev,
> - value, &retval);
> + /* Some machines do not return an error code as a result, so we ignore it */
> + err = asus_wmi_set_devstate(asus->throttle_thermal_policy_dev, value, NULL);
>
> sysfs_notify(&asus->platform_device->dev.kobj, NULL,
> "throttle_thermal_policy");
> @@ -3729,12 +3728,6 @@ static int throttle_thermal_policy_write(struct asus_wmi *asus)
> return err;
> }
>
> - if (retval != 1) {
> - pr_warn("Failed to set throttle thermal policy (retval): 0x%x\n",
> - retval);
> - return -EIO;
> - }
> -
> /* Must set to disabled if mode is toggled */
> if (asus->cpu_fan_curve_available)
> asus->custom_fan_curves[FAN_CURVE_DEV_CPU].enabled = false;
> --
> 2.39.5
>
next prev parent reply other threads:[~2024-11-25 9:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-24 17:19 Armin Wolf
2024-11-25 9:39 ` Hans de Goede [this message]
2024-11-29 19:29 ` Armin Wolf
2024-12-02 14:23 ` Armin Wolf
2024-12-02 14:29 ` Ilpo Järvinen
2024-12-02 14:32 ` Armin Wolf
2024-12-02 17:03 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13590dd6-1529-487c-842a-85b44c577811@redhat.com \
--to=hdegoede@redhat.com \
--cc=W_Armin@gmx.de \
--cc=auslands-kv@gmx.de \
--cc=corentin.chary@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®