X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Don't report non-present second fan on models with quirk
@ 2026-04-11 15:34 LevitatingBusinessMan (Rein Fernhout)
  2026-05-06 13:35 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: LevitatingBusinessMan (Rein Fernhout) @ 2026-04-11 15:34 UTC (permalink / raw)
  To: hmh
  Cc: mpearson-lenovo, platform-driver-x86, hansg,
	LevitatingBusinessMan (Rein Fernhout)

Some models report a second-fan with speed 65535 indicating that this fan is not present.

A previous fix (a10d50983f7be) disabled these fans.

However, the else branch still enables the fan on some models with a quirk enabled.

Namely the P15v Gen 1 has such a quirk, introduced in e8637dfca15e0.

Although it appears the P15 Gen 1 does have a second fan, the P15v Gen 1 does not (reporting speed 65535).

I think in all cases, this can be solved by never enabling the fan if it is detected and the reported speed reads 65535.

To do so, we only run the else branch if no fan was detected.
---
 drivers/platform/x86/lenovo/thinkpad_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index 8982d92dfd97..282a0c54ce0c 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -8948,7 +8948,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
 				/* fan control not currently available for ns ECFW */
 				tp_features.second_fan_ctl = !fan_with_ns_addr;
 				pr_info("secondary fan control detected & enabled\n");
-			} else {
+			} else if (res < 0) {
 				/* Fan not auto-detected */
 				tp_features.second_fan = 0;
 				if (quirks & TPACPI_FAN_2FAN) {
-- 
2.53.0


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

* Re: [PATCH] platform/x86: thinkpad_acpi: Don't report non-present second fan on models with quirk
  2026-04-11 15:34 [PATCH] platform/x86: thinkpad_acpi: Don't report non-present second fan on models with quirk LevitatingBusinessMan (Rein Fernhout)
@ 2026-05-06 13:35 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2026-05-06 13:35 UTC (permalink / raw)
  To: LevitatingBusinessMan (Rein Fernhout)
  Cc: hmh, mpearson-lenovo, platform-driver-x86, hansg

On Sat, 11 Apr 2026, LevitatingBusinessMan (Rein Fernhout) wrote:

> Some models report a second-fan with speed 65535 indicating that this fan is not present.
> 
> A previous fix (a10d50983f7be) disabled these fans.

Please see Documentation/process/submitting-patches.rst how to format 
commit references correctly.

> 
> However, the else branch still enables the fan on some models with a quirk enabled.
> 
> Namely the P15v Gen 1 has such a quirk, introduced in e8637dfca15e0.
> 
> Although it appears the P15 Gen 1 does have a second fan, the P15v Gen 1 does not (reporting speed 65535).
> 
> I think in all cases, this can be solved by never enabling the fan if it is detected and the reported speed reads 65535.
> 
> To do so, we only run the else branch if no fan was detected.

Please fold the changelog paragraphs at 72 chars.

This change should have a Fixes tag.

I cannot apply patches without sign off, again, please see 
Documentation/process/submitting-patches.rst.

> ---
>  drivers/platform/x86/lenovo/thinkpad_acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> index 8982d92dfd97..282a0c54ce0c 100644
> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> @@ -8948,7 +8948,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
>  				/* fan control not currently available for ns ECFW */
>  				tp_features.second_fan_ctl = !fan_with_ns_addr;
>  				pr_info("secondary fan control detected & enabled\n");
> -			} else {
> +			} else if (res < 0) {

As this is now clearly an error handling block, it should be the first one 
to follow the call so you should switch to order of the code blocks.

>  				/* Fan not auto-detected */
>  				tp_features.second_fan = 0;

Unrelated to this patch, I don't know why is this line necessary at all.
It was cleared earlier in the same function (and even that clearing is 
probably not considering the default initial value which implies it should 
already be 0).

>  				if (quirks & TPACPI_FAN_2FAN) {

It might be cleaner to put this entire 2nd fan init to own function as 
could return early from it when no 2nd fan is detected.

-- 
 i.


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

end of thread, other threads:[~2026-05-06 13:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11 15:34 [PATCH] platform/x86: thinkpad_acpi: Don't report non-present second fan on models with quirk LevitatingBusinessMan (Rein Fernhout)
2026-05-06 13:35 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox