lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97fb005c-92bc-790b-80b0-75149a799b4b@linux.intel.com>
Date: Wed, 14 Feb 2024 12:22:57 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Vishnu Sankar <vishnuocv@...il.com>
cc: Hans de Goede <hdegoede@...hat.com>, platform-driver-x86@...r.kernel.org, 
    LKML <linux-kernel@...r.kernel.org>, 
    Mark Pearson <mpearson-lenovo@...ebb.ca>, vsankar@...ovo.com
Subject: Re: [PATCH 2/2] platform/x86: thinkpad_acpi: Fix to correct wrong
 temp reporting on some ThinkPads

On Wed, 14 Feb 2024, Vishnu Sankar wrote:

> Added non-standard thermal register support for some ThinkPads.
> 
> Some of the Thinkpads use a non-standard ECFW which use different
> thermal register addresses.
> This is a fix to correct the wrong temperature reporting on
> those systems.
> 
> Tested on Lenovo ThinkPad L13 Yoga Gen2
> 
> Suggested-by: Mark Pearson <mpearson-lenovo@...ebb.ca>
> Signed-off-by: Vishnu Sankar <vishnuocv@...il.com>
> ---
> -Improvements as requested.
> -Improved the readability in case TPACPI_THERMAL_TPEC_12.
> -idx < 8 from idx idx <=7 to match idx = 8
> -KILO used from linux/units.h instead of 1000.

>  static enum thermal_access_mode thermal_read_mode;
>  static bool thermal_use_labels;
> +static bool thermal_with_ns_address;	/*Non-standard thermal reg address*/

Comment is missing spaces.

> @@ -6239,6 +6267,20 @@ static int thermal_get_sensor(int idx, s32 *value)
>  		}
>  		break;
>  
> +	/* The Non-standard EC uses 12 Thermal areas */
> +	case TPACPI_THERMAL_TPEC_12:
> +		if (idx >= 12)
> +			return -EINVAL;
> +
> +		t = idx < 8 ? TP_EC_THERMAL_TMP0_NS + idx :
> +				TP_EC_THERMAL_TMP8_NS + (idx - 8);
> +
> +		if (!acpi_ec_read(t, &tmp))
> +			return -EIO;
> +
> +		*value = tmp * KILO;

Hmm, MILLI would be much more approriate here? But if this relates to 
degrees, there is MILLIDEGREE_PER_DEGREE?

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ