Patch "platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-x86-thinkpad_acpi-fix-reporting-a-non-prese.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5178d81a7588379e11c343277a216b57ad7bd495
Author: Jelle van der Waa <jvanderwaa@xxxxxxxxxx>
Date:   Wed Oct 19 21:47:51 2022 +0200

    platform/x86: thinkpad_acpi: Fix reporting a non present second fan on some models
    
    [ Upstream commit a10d50983f7befe85acf95ea7dbf6ba9187c2d70 ]
    
    thinkpad_acpi was reporting 2 fans on a ThinkPad T14s gen 1, even though
    the laptop has only 1 fan.
    
    The second, not present fan always reads 65535 (-1 in 16 bit signed),
    ignore fans which report 65535 to avoid reporting the non present fan.
    
    Signed-off-by: Jelle van der Waa <jvanderwaa@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221019194751.5392-1-jvanderwaa@xxxxxxxxxx
    Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 2dbb9fc011a7..353507d18e11 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -263,6 +263,8 @@ enum tpacpi_hkey_event_t {
 #define TPACPI_DBG_BRGHT	0x0020
 #define TPACPI_DBG_MIXER	0x0040
 
+#define FAN_NOT_PRESENT		65535
+
 #define strlencmp(a, b) (strncmp((a), (b), strlen(b)))
 
 
@@ -8876,7 +8878,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
 			/* Try and probe the 2nd fan */
 			tp_features.second_fan = 1; /* needed for get_speed to work */
 			res = fan2_get_speed(&speed);
-			if (res >= 0) {
+			if (res >= 0 && speed != FAN_NOT_PRESENT) {
 				/* It responded - so let's assume it's there */
 				tp_features.second_fan = 1;
 				tp_features.second_fan_ctl = 1;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux