Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp130111rdb; Wed, 14 Feb 2024 15:24:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrffIYIojfILN1hS5VnTLlZcm4UIUeqNK0O7Su/Gb5U0slusl1kj2lHLcqVmox35DHr3e0xcIJUcRzDTFrM/6JoEwHMnVQmA7Jgqb8gA== X-Google-Smtp-Source: AGHT+IFdRynUwKxNCYu1xISpgUH9IG+6ZfHARm8H/u2CK6JZWKf00YUHyj5RPFLTosJlU+daoCZY X-Received: by 2002:a05:6870:a113:b0:21a:1426:dccc with SMTP id m19-20020a056870a11300b0021a1426dcccmr25998oae.32.1707953076264; Wed, 14 Feb 2024 15:24:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707953076; cv=pass; d=google.com; s=arc-20160816; b=q59s38iC6vkO+vWdsuS/k2otFlZqEqcb0zp9E/lJmwyV51OLPQIO6Zak6VWDdLm3Gw 3SWwDDL0bSSpGBYNsIM1D1Cv3T/O7X/8tnvU7tnNFGRFJsJdfJvGdnwMqwSGbStBlAyK oEHX0W2C17axLPrxMvFn2y7rzq3c3nokHY4K/w+Ze6ke44kpvT46p25JFUnck9Kzsj/u mZUlDhVgyHCHX19AOY/yKjE/K0UeGDBjBUYP2zHlDNlaIKxTB0jY7anNUnpjciB7m6ZS B9K1lrmg4NwaPTE8BZJdP33L4XeYkaacnFnJsXB+3MoQ+PFN+7OYbHApZ/WpLmnHyQbp 1Tpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=tWY3HMGT42kRA4mnl0XJ+CvSiYyESAW/yGq2N3G+inI=; fh=9nQdUG9EVtlTcjqb+xx2I7++IIn1WAk/b79A6YnKOIw=; b=R3MxqJJwk2tEpooPibVzjyYvI1aW19ZJMaXVdqmRA5Dc0bntFYTA0DV6XM+NGvAqDT PkPlFVxJ7aw0YzeDtom0eIlOpMAMjuRMoKXO0CF8MPzt3spuVWLGkJn5Wv+FqkoErnwk awFR/17egnASd4xFhuCAqj9aZ28jj++qgcmEgZx+W+9yPzq1SX3zjdhNuldI4v182pnT B5qlufuHAj3YjMqAci+F0SnenMFDlQUsJkg2WqwN8sDlxFYCZ39uUnbIdsQnqZDO8oQr /ubstRMucp7BlVOa8W8/ODgCwTVS77nTQSu5HA6ptsZDoB/23h9H/U1c7ZGdM6hmd/Q0 bd+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QWm3GjoV; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66116-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXGZogcxw1owtcHPZpaVhy8B2NmAmitvs5FL27IYGSXtvDSHHJ929O/Vc6kadRvEO8d1vP9JoE3mn23JaNx0f9xoPV9POYbQ8U+BpvEPQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 71-20020a63014a000000b005dc833ef4e5si3825420pgb.64.2024.02.14.15.24.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 15:24:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66116-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QWm3GjoV; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66116-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 13D6D291329 for ; Wed, 14 Feb 2024 23:23:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AAB61419B1; Wed, 14 Feb 2024 23:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QWm3GjoV" Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3599413472B; Wed, 14 Feb 2024 23:22:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707952974; cv=none; b=XwOeCbqzhLb9c/F4R3cMZO/Qp7Zp6nIbyeZwQNaTEMOZzkr15qHTUeZT+eL9xmnyaOrMF2pnqtaVUHIu2lxAEbs9pNk99etkZOzEwH52qT163dgy6QgfFayYdHcPVpYAjDbp6+FrRi5OSuElEBqYpjoWweGOYd20axrfDMG0DhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707952974; c=relaxed/simple; bh=3EQISA5BWKfjM0TIHlpP5btzvK3B1+UPqI77iwEpkJQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YCJHZI8sMXra0W1qigyDA81lfDRK99BJjIhrrHxZ15ozd1YL91zr1qoVZs4v+LyB+6iUH9RyGtMyBwKU3bVBBOXdzl2KgZFH+hTdiDrQ3xzfHwhcgDBPPxngtN+wt40yr6GkEJPmFLMhzPZJxCT4nxAIbhCE68C0M3KeR8l4jLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QWm3GjoV; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5dbcfa0eb5dso271629a12.3; Wed, 14 Feb 2024 15:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707952972; x=1708557772; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tWY3HMGT42kRA4mnl0XJ+CvSiYyESAW/yGq2N3G+inI=; b=QWm3GjoVICtC5j8mPP4dQz0oGqQQvWKtup7cHtkQFL9f49NJtzgYFCQlEEUWZr6H5N hJhYyDLb5eQqb4VQnZlRpy0SnA195XKFAr3KHGUZaCqq2pgjR+CC7HxbGEO986CG6GaB 6G1JwtqvTf+QmoBdsm99Ux0ncE23dxj+B8VrKDxmFWzMOKGxdAFuwEyzyeiPPMm9DXc2 5E3F++JBOTW09+G7wsap/2GJXfc1y5b/H/LPnxwcIxBhoW4mQPNc3umM6hvAafMEx/hZ 7/Gecf5thrOCNss50ff2ViC5xgZddov7ubf4EPXBI/CUpERL4ZCVU4FC88B9QLVjBV7/ qsrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707952972; x=1708557772; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tWY3HMGT42kRA4mnl0XJ+CvSiYyESAW/yGq2N3G+inI=; b=HzqP491vlWRg3373f4kTQn4SaocEJZaKlHtvpq3pAoKN4mx0yDxZlUlgfjHGXcN8D0 Actc9wPHzg1kMIirkhfqIVv+Oc1yBhWsEXEjBCAeE9R+4lUTdDEkrM4cGGyL40nEhuTc EXHqNkjRePGXZxNc8sSn9UOCiR6bvRIFQgUU29T+qTrI3FkJxhMum2LHrqsl9ccmEOBH CYJIqsA6DhEgUCgqT0xmuYRoFIdauEGdU1uESAuUBEV1KeszGuzi6jx9AzZRklYNOR9p jjElmCuroei1lxe2/07Pfaj9pr5nKciW5v2PFamyr0+Gw1MLyYiXoMEuppdUBigxSURv WHIg== X-Forwarded-Encrypted: i=1; AJvYcCWoRCo8f6PeJEUpfbyRfNoeMQX10Peodzr2K4EYmc2kWAcMG5byGBOBFWDEYgcAU7xWGjbJL2NPo5ANwmRj+rMlJ/DyrdK8cyWHonIx+LuyaoXt0r9S9fQZ8kB7dEr5EgU4gLuGvM6gFzKItlikxH4C/w== X-Gm-Message-State: AOJu0Yz9ntfZSsHr//M8cTYeRPPt9O2erCbYLa5iCLOBGjZSzNEJxXDC 5nYenwJAyfcnIh1TAICPl6MS5Z+IpqlMB0yK+FOs3PTfdfj6rOnqdc8PAbuErkVq9din+YU1Xcp tquplAtQTJHJRChar14wyPUPr1XU= X-Received: by 2002:a05:6a20:d046:b0:19c:ac7f:c3e4 with SMTP id hv6-20020a056a20d04600b0019cac7fc3e4mr247735pzb.42.1707952972287; Wed, 14 Feb 2024 15:22:52 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240214052959.8550-1-vishnuocv@gmail.com> <20240214052959.8550-2-vishnuocv@gmail.com> <97fb005c-92bc-790b-80b0-75149a799b4b@linux.intel.com> In-Reply-To: <97fb005c-92bc-790b-80b0-75149a799b4b@linux.intel.com> From: Vishnu Sankar Date: Thu, 15 Feb 2024 08:22:13 +0900 Message-ID: Subject: Re: [PATCH 2/2] platform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, LKML , Mark Pearson , vsankar@lenovo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ilpo, Thanks for the review. On Wed, Feb 14, 2024 at 7:23=E2=80=AFPM Ilpo J=C3=A4rvinen wrote: > > 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 uses 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 > > Signed-off-by: Vishnu Sankar > > --- > > -Improvements as requested. > > -Improved the readability in case TPACPI_THERMAL_TPEC_12. > > -idx < 8 from idx idx <=3D7 to match idx =3D 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 addres= s*/ > > Comment is missing spaces. Acked. > > > @@ -6239,6 +6267,20 @@ static int thermal_get_sensor(int idx, s32 *valu= e) > > } > > break; > > > > + /* The Non-standard EC uses 12 Thermal areas */ > > + case TPACPI_THERMAL_TPEC_12: > > + if (idx >=3D 12) > > + return -EINVAL; > > + > > + t =3D idx < 8 ? TP_EC_THERMAL_TMP0_NS + idx : > > + TP_EC_THERMAL_TMP8_NS + (idx - 8); > > + > > + if (!acpi_ec_read(t, &tmp)) > > + return -EIO; > > + > > + *value =3D tmp * KILO; > > Hmm, MILLI would be much more approriate here? But if this relates to > degrees, there is MILLIDEGREE_PER_DEGREE? Will Change to MILLIDEGREE_PER_DEGREE from KILO > > Reviewed-by: Ilpo J=C3=A4rvinen > > -- > i. --=20 Regards, Vishnu Sankar +817015150407 (Japan)