Re: [PATCH] platform/x86: thinkpad_acpi: Add quirk for ThinkPads without a fan

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

 



Hi,

On 1/12/22 12:18, Alexander Kobel wrote:
> Some ThinkPad models, like the X1 Tablet 1st and 2nd Gen, are passively
> cooled without any fan.  Currently, an entry in /proc/acpi/ibm/fan is
> nevertheless created, and misleadingly shows
> 	status:		enabled
> 	speed:		65535
> 	level:		auto
> 
> This patch adds a TPACPI_FAN_NOFAN quirk definition and corresponding
> handling to not initialize a fan interface at all.
> 
> For the time being, the quirk is only applied for X1 Tablet 2nd Gen
> (types 20JB, 20JC; EC N1O...); further models (such as Gen1, types 20GG
> and 20GH) can be added easily once tested.
> 
> Tested on a 20JCS00C00, BIOS N1OET58W (1.43), EC N1OHT34W.
> 
> Signed-off-by: Alexander Kobel <a-kobel@xxxxxxxxxx>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>

I expect Mark possibly coming-up with a better way to detect the number
of fans in a ThinkPad to take quite a while, so I've merged this for now
and then eventually we can replace it with a better fix if one shows up:

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans



> ---
>  drivers/platform/x86/thinkpad_acpi.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index e03df2881dc6..7dbe4061bc8a 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8767,9 +8767,10 @@ static const struct attribute_group fan_attr_group = {
>  	.attrs = fan_attributes,
>  };
>  
> -#define TPACPI_FAN_Q1	0x0001		/* Unitialized HFSP */
> -#define TPACPI_FAN_2FAN	0x0002		/* EC 0x31 bit 0 selects fan2 */
> -#define TPACPI_FAN_2CTL	0x0004		/* selects fan2 control */
> +#define TPACPI_FAN_Q1		0x0001		/* Uninitialized HFSP */
> +#define TPACPI_FAN_2FAN		0x0002		/* EC 0x31 bit 0 selects fan2 */
> +#define TPACPI_FAN_2CTL		0x0004		/* selects fan2 control */
> +#define TPACPI_FAN_NOFAN	0x0008		/* no fan available */
>  
>  static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
>  	TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
> @@ -8787,6 +8788,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
>  	TPACPI_Q_LNV3('N', '2', 'O', TPACPI_FAN_2CTL),	/* P1 / X1 Extreme (2nd gen) */
>  	TPACPI_Q_LNV3('N', '2', 'V', TPACPI_FAN_2CTL),	/* P1 / X1 Extreme (3nd gen) */
>  	TPACPI_Q_LNV3('N', '3', '0', TPACPI_FAN_2CTL),	/* P15 (1st gen) / P15v (1st gen) */
> +	TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN),	/* X1 Tablet (2nd gen) */
>  };
>  
>  static int __init fan_init(struct ibm_init_struct *iibm)
> @@ -8816,6 +8818,11 @@ static int __init fan_init(struct ibm_init_struct *iibm)
>  	quirks = tpacpi_check_quirks(fan_quirk_table,
>  				     ARRAY_SIZE(fan_quirk_table));
>  
> +	if (quirks & TPACPI_FAN_NOFAN) {
> +		pr_info("No integrated ThinkPad fan available\n");
> +		return 1;
> +	}
> +
>  	if (gfan_handle) {
>  		/* 570, 600e/x, 770e, 770x */
>  		fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN;
> 




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux