All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: asus-wmi: Fix regression when probing for fan curve control
@ 2022-02-05 11:28 Hans de Goede
  2022-02-05 12:05 ` Abhijeet Viswa
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2022-02-05 11:28 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko
  Cc: Hans de Goede, platform-driver-x86, Abhijeet V

The fan curve control patches introduced a regression for at least the
TUF FX506 and possibly other TUF series laptops that do not have support
for fan curve control.

As part of the probing process, asus_wmi_evaluate_method_buf is called
to get the factory default fan curve . The WMI management function
returns 0 on certain laptops to indicate lack of fan curve control
instead of ASUS_WMI_UNSUPPORTED_METHOD. This 0 is transformed to
-ENODATA which results in failure when probing.

Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves")
Reported-by: Abhijeet V <abhijeetviswa@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/asus-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index a3b83b22a3b1..2104a2621e50 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2223,7 +2223,7 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available,
 
 	err = fan_curve_get_factory_default(asus, fan_dev);
 	if (err) {
-		if (err == -ENODEV)
+		if (err == -ENODEV || err == -ENODATA)
 			return 0;
 		return err;
 	}
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: Fix regression when probing for fan curve control
  2022-02-05 11:28 [PATCH] platform/x86: asus-wmi: Fix regression when probing for fan curve control Hans de Goede
@ 2022-02-05 12:05 ` Abhijeet Viswa
  2022-02-05 13:45   ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Abhijeet Viswa @ 2022-02-05 12:05 UTC (permalink / raw)
  To: Hans de Goede, Mark Gross, Andy Shevchenko; +Cc: platform-driver-x86

Hi,

Tested this out and it works as expected. Thanks for the quick resolution!

Thanks
Abhijeet

On 05/02/22 16:58, Hans de Goede wrote:
> The fan curve control patches introduced a regression for at least the
> TUF FX506 and possibly other TUF series laptops that do not have support
> for fan curve control.
> 
> As part of the probing process, asus_wmi_evaluate_method_buf is called
> to get the factory default fan curve . The WMI management function
> returns 0 on certain laptops to indicate lack of fan curve control
> instead of ASUS_WMI_UNSUPPORTED_METHOD. This 0 is transformed to
> -ENODATA which results in failure when probing.
> 
> Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves")
> Reported-by: Abhijeet V <abhijeetviswa@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/platform/x86/asus-wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index a3b83b22a3b1..2104a2621e50 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2223,7 +2223,7 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available,
>  
>  	err = fan_curve_get_factory_default(asus, fan_dev);
>  	if (err) {
> -		if (err == -ENODEV)
> +		if (err == -ENODEV || err == -ENODATA)
>  			return 0;
>  		return err;
>  	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: asus-wmi: Fix regression when probing for fan curve control
  2022-02-05 12:05 ` Abhijeet Viswa
@ 2022-02-05 13:45   ` Hans de Goede
  0 siblings, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2022-02-05 13:45 UTC (permalink / raw)
  To: Abhijeet Viswa, Mark Gross, Andy Shevchenko; +Cc: platform-driver-x86

Hi,

On 2/5/22 13:05, Abhijeet Viswa wrote:
> Hi,
> 
> Tested this out and it works as expected. Thanks for the quick resolution!

Thank you,

I've added this to my review-hans (soon to be for-next) branch now
I'll also include this in my next fixes pull-req for 5.17 (the bug
only exists in 5.17).

Regards,

Hans


> On 05/02/22 16:58, Hans de Goede wrote:
>> The fan curve control patches introduced a regression for at least the
>> TUF FX506 and possibly other TUF series laptops that do not have support
>> for fan curve control.
>>
>> As part of the probing process, asus_wmi_evaluate_method_buf is called
>> to get the factory default fan curve . The WMI management function
>> returns 0 on certain laptops to indicate lack of fan curve control
>> instead of ASUS_WMI_UNSUPPORTED_METHOD. This 0 is transformed to
>> -ENODATA which results in failure when probing.
>>
>> Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves")
>> Reported-by: Abhijeet V <abhijeetviswa@gmail.com>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  drivers/platform/x86/asus-wmi.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
>> index a3b83b22a3b1..2104a2621e50 100644
>> --- a/drivers/platform/x86/asus-wmi.c
>> +++ b/drivers/platform/x86/asus-wmi.c
>> @@ -2223,7 +2223,7 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available,
>>  
>>  	err = fan_curve_get_factory_default(asus, fan_dev);
>>  	if (err) {
>> -		if (err == -ENODEV)
>> +		if (err == -ENODEV || err == -ENODATA)
>>  			return 0;
>>  		return err;
>>  	}
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-05 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-05 11:28 [PATCH] platform/x86: asus-wmi: Fix regression when probing for fan curve control Hans de Goede
2022-02-05 12:05 ` Abhijeet Viswa
2022-02-05 13:45   ` Hans de Goede

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.