* [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
@ 2024-11-24 17:19 Armin Wolf
2024-11-25 9:39 ` Hans de Goede
2024-12-02 17:03 ` Ilpo Järvinen
0 siblings, 2 replies; 7+ messages in thread
From: Armin Wolf @ 2024-11-24 17:19 UTC (permalink / raw)
To: auslands-kv, corentin.chary, luke
Cc: hdegoede, ilpo.jarvinen, platform-driver-x86, linux-kernel
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>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
2024-11-24 17:19 [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy Armin Wolf
@ 2024-11-25 9:39 ` Hans de Goede
2024-11-29 19:29 ` Armin Wolf
2024-12-02 17:03 ` Ilpo Järvinen
1 sibling, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2024-11-25 9:39 UTC (permalink / raw)
To: Armin Wolf, auslands-kv, corentin.chary, luke
Cc: ilpo.jarvinen, platform-driver-x86, linux-kernel
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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
2024-11-25 9:39 ` Hans de Goede
@ 2024-11-29 19:29 ` Armin Wolf
2024-12-02 14:23 ` Armin Wolf
0 siblings, 1 reply; 7+ messages in thread
From: Armin Wolf @ 2024-11-29 19:29 UTC (permalink / raw)
To: Hans de Goede, auslands-kv, corentin.chary, luke
Cc: ilpo.jarvinen, platform-driver-x86, linux-kernel
Am 25.11.24 um 10:39 schrieb Hans de Goede:
> 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
I forgot to add the following tag:
Tested-by: auslands-kv@gmx.de
Can we pick this patch for the next fixes pull?
Thanks,
Armin Wolf
>> ---
>> 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
>>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
2024-11-29 19:29 ` Armin Wolf
@ 2024-12-02 14:23 ` Armin Wolf
2024-12-02 14:29 ` Ilpo Järvinen
0 siblings, 1 reply; 7+ messages in thread
From: Armin Wolf @ 2024-12-02 14:23 UTC (permalink / raw)
To: Hans de Goede, auslands-kv, corentin.chary, luke
Cc: ilpo.jarvinen, platform-driver-x86, linux-kernel
Am 29.11.24 um 20:29 schrieb Armin Wolf:
> Am 25.11.24 um 10:39 schrieb Hans de Goede:
>
>> 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
>
> I forgot to add the following tag:
>
> Tested-by: auslands-kv@gmx.de
>
> Can we pick this patch for the next fixes pull?
>
> Thanks,
> Armin Wolf
>
Another user (Edoardo Brogiolo <brogioloedoardo@gmail.com>) reported a similar issue with another Asus machine,
see https://bbs.archlinux.org/viewtopic.php?id=301341 for details.
Are there any blockers left for this patch to get accepted upstream?
Thanks,
Armin Wolf
>>> ---
>>> 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
>>>
>>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
2024-12-02 14:23 ` Armin Wolf
@ 2024-12-02 14:29 ` Ilpo Järvinen
2024-12-02 14:32 ` Armin Wolf
0 siblings, 1 reply; 7+ messages in thread
From: Ilpo Järvinen @ 2024-12-02 14:29 UTC (permalink / raw)
To: Armin Wolf
Cc: Hans de Goede, auslands-kv, corentin.chary, luke,
platform-driver-x86, LKML
[-- Attachment #1: Type: text/plain, Size: 3661 bytes --]
On Mon, 2 Dec 2024, Armin Wolf wrote:
> Am 29.11.24 um 20:29 schrieb Armin Wolf:
> > Am 25.11.24 um 10:39 schrieb Hans de Goede:
> > > 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
> >
> > I forgot to add the following tag:
> >
> > Tested-by: auslands-kv@gmx.de
> >
> > Can we pick this patch for the next fixes pull?
> >
> > Thanks,
> > Armin Wolf
> >
> Another user (Edoardo Brogiolo <brogioloedoardo@gmail.com>) reported a similar
> issue with another Asus machine,
> see https://bbs.archlinux.org/viewtopic.php?id=301341 for details.
>
> Are there any blockers left for this patch to get accepted upstream?
Hi Armin,
I don't think there are any blocker I'm aware of. It's just that I'm
extremely busy right after the merge window has closed as usual.
--
i.
> > > > ---
> > > > 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
> > > >
> > >
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
2024-12-02 14:29 ` Ilpo Järvinen
@ 2024-12-02 14:32 ` Armin Wolf
0 siblings, 0 replies; 7+ messages in thread
From: Armin Wolf @ 2024-12-02 14:32 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Hans de Goede, auslands-kv, corentin.chary, luke,
platform-driver-x86, LKML
Am 02.12.24 um 15:29 schrieb Ilpo Järvinen:
> On Mon, 2 Dec 2024, Armin Wolf wrote:
>> Am 29.11.24 um 20:29 schrieb Armin Wolf:
>>> Am 25.11.24 um 10:39 schrieb Hans de Goede:
>>>> 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
>>> I forgot to add the following tag:
>>>
>>> Tested-by: auslands-kv@gmx.de
>>>
>>> Can we pick this patch for the next fixes pull?
>>>
>>> Thanks,
>>> Armin Wolf
>>>
>> Another user (Edoardo Brogiolo <brogioloedoardo@gmail.com>) reported a similar
>> issue with another Asus machine,
>> see https://bbs.archlinux.org/viewtopic.php?id=301341 for details.
>>
>> Are there any blockers left for this patch to get accepted upstream?
> Hi Armin,
>
> I don't think there are any blocker I'm aware of. It's just that I'm
> extremely busy right after the merge window has closed as usual.
>
Ok, then i will just wait a bit.
Thanks,
Armin Wolf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy
2024-11-24 17:19 [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy Armin Wolf
2024-11-25 9:39 ` Hans de Goede
@ 2024-12-02 17:03 ` Ilpo Järvinen
1 sibling, 0 replies; 7+ messages in thread
From: Ilpo Järvinen @ 2024-12-02 17:03 UTC (permalink / raw)
To: auslands-kv, corentin.chary, luke, Armin Wolf
Cc: hdegoede, platform-driver-x86, linux-kernel
On Sun, 24 Nov 2024 18:19:41 +0100, 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.
>
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: asus-wmi: Ignore return value when writing thermal policy
commit: 25fb5f47f34d90aceda2c47a4230315536e97fa8
--
i.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-12-02 17:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-24 17:19 [PATCH] platform/x86: asus-wmi: Ignore return value when writing thermal policy Armin Wolf
2024-11-25 9:39 ` Hans de Goede
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
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.