Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp329550rdb; Thu, 8 Feb 2024 07:11:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWRamuAaZ0LgtG4WCmgNEswlfCEX6alCIxV1nLc1FcMxUVUbAnWtYSTGhE5bz13IwvKND+oLfuwlFP422UcZFhsesrH/wl4aQNemGc8Hg== X-Google-Smtp-Source: AGHT+IH22X6+wDyZiTa1EbHWkOM74cOajuFihJHWG/h2W8TG16O0GBAW1JZOmD8RXUmlrOJtcTKY X-Received: by 2002:a05:6a20:d80d:b0:19e:a9e6:96d with SMTP id iv13-20020a056a20d80d00b0019ea9e6096dmr4046487pzb.55.1707405100191; Thu, 08 Feb 2024 07:11:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707405100; cv=pass; d=google.com; s=arc-20160816; b=oKPLTolYKwcEyXemInjoMpTUzj7xId810O0sNFg2oa5Q6SkIBfxYsTtojJErayFgpj rvHD01rBEnD9FteBtpD6yyj9VZq4Jk2htg5gyisDZgGDjolsHUyZh219FjNb9owyLvh+ OJBxSlmhMRqUoKZozzWsSeor8VYsd8pdBqEg5/3Hnk7ojFWiqjnxZxzodpp4ysmTjiLv s/HMA/ELODuEJkf0tLV1dBuArXvo93NES998aP8+danV72xkbvXrM0XYJHtVNy8SNzvQ /zRURBNMmwTOxsQb/9Lgrgxtjw//dU4ypp6SFSyhg+ZPcZnRF/zFex5YALYegcA0yu1w pVcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:message-id:in-reply-to:subject:cc:to:date :from:dkim-signature; bh=2JM4bbNLlpEB6lPO7H5gEEw7FJGfN2Ca9bVMiau6LiA=; fh=FuA1pRExRwjf35IPRjM1UOMdE1FLwVCTvgmZ8rYSDF4=; b=jwR32oGrbuQJCra41oK5AsRnBm6m8o8gajI2aRPMFlZ9DSMT5ZT/UfNS9Q8uXy1sP6 y13TXBQ1CSpk0J6psG07FexGAvgyJh++NJ9fu9fEeLGdG80DZrMjuLntOHEBdpYOZvwp DZhf5ab7tsWklLmcDeuPH/FPHN1PzRp4ep4WtbaeXi/khCXCLq9tZy/QMh3SVFuAzuKq X12RuYAEox8dszzSwGr1GAlSo3/bkNllc8f8DpLjvXg53/16ZKR4IwBG0D36y68fOPdv ogHwl3w97I0EjP6fm8Bjbeh8KsrWEqgLDF+UDAm4m82IlQLBQCgmBSDl1nDcT5UqwFmx qFDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LlrB3k5z; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUBTHJTd8DhLyhZe4AUJb+zt+/qgzfGbUPsAR0rYG/B9bk+mOhdSW0kDYM2qlzPlyEwnicymN0vKeBbPGchYP3tp7LrTrEPYf3OiFAZig== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f6-20020aa79d86000000b006e04369998fsi4203496pfq.15.2024.02.08.07.11.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 07:11:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LlrB3k5z; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58269-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58269-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 D57A2282BEF for ; Thu, 8 Feb 2024 15:11:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A29537B3C9; Thu, 8 Feb 2024 15:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LlrB3k5z" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC481768F7; Thu, 8 Feb 2024 15:11:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707405091; cv=none; b=eIM5yU9XJd2fG5AusnDPDe4qSPJzpYbNBtcH/1tNWizKIe86t+5qZEmKtgh9G/qLrprNvUqyq/RWgb0fxdYcsU54GNHpHBPIkR5BjSYl+nteoMx/s9DAmWUUTnHTBvBevRMnVgZbaJIPsasua7X3DoQTVXWVIlKWS3mhYgUpwYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707405091; c=relaxed/simple; bh=/E29gLn3iCL7gPLUbNGH1GmxyWYk0YmDRNTGoiudIu4=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=QgvreXVBg69lYLzjevS0TLx5sksHk2AVG7piG6P1VRbZOrh39xqEHeErQUBznSe0XWhlhPwCNnkTbkjrb50R/TPds+rFLM+Cd7g46SPkFdbODXxswpc393vBHZ9ZFgyM2cbrSlfs6xU0UYFy1I6JROvjpmusMERjKYxFLL8Kq6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LlrB3k5z; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707405090; x=1738941090; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=/E29gLn3iCL7gPLUbNGH1GmxyWYk0YmDRNTGoiudIu4=; b=LlrB3k5zgLQaggfW0Zi4V3qM9r9BV6ihoMlho5fyE+xASxbImOpkhr64 l3fQFsLUf9D+quJEhneaGbgseZn8VhasUo6exF+Ahhrw5nFVMZz9fpxmC Btub7rr7c469TfCaDAogbUSHvowhKRo02S1IWYXuQQKDvbEVTzvJvLMVz Kml74S1BOjvkpA/qRCdloGTUjRUCYPMEJRdfqURmkKSXwBMqGLhU0SAll 81NLIW8gSdsMJc6wEh4xeh1eU9o84CC8Ggdd0S8Ai+FDtc7cXWifyKTZm 2M1AFYBouWGRsqmN3aCfoJck0IDBRamoUewDjdUQu0JjWv5gSiOqQbcAC Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="12602963" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="12602963" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 07:11:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1670115" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.246.52.95]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 07:11:26 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Thu, 8 Feb 2024 17:11:23 +0200 (EET) To: Vishnu Sankar cc: Hans de Goede , platform-driver-x86@vger.kernel.org, LKML , vsankar@lenovo.com, Mark Pearson Subject: Re: [PATCH] Fix to correct wrong temp reporting on some ThinkPads In-Reply-To: Message-ID: <2f280707-7250-4bb2-460c-5f8a02208179@linux.intel.com> References: <20240131180757.35044-1-vishnuocv@gmail.com> <901e1fb0-1e42-7bf7-113d-3d0bbb62f4da@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323328-1463870039-1707404934=:1104" Content-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1463870039-1707404934=:1104 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: <70fd06fb-ff27-7c79-0c7b-d07f2c055c0d@linux.intel.com> On Thu, 8 Feb 2024, Vishnu Sankar wrote: > Thanks a lot for the review. > And sorry for the delay in response. Small improvements to my earlier version below now that I reread it. > On Tue, Feb 6, 2024 at 8:03=E2=80=AFPM Ilpo J=C3=A4rvinen wrote: >=20 > > @@ -6174,6 +6191,21 @@ static int thermal_get_sensor(int idx, s32 *valu= e) =2E.. > A code reader would be served much better if this convoluted logic = is > simplied to: >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 case TPACPI_THERMAL_TPEC_12: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (idx >= =3D 12) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 return -EINVAL; >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (idx <= =3D 7) if (idx < 8) =09<- to match idx - 8 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ec_offset =3D TP_EC_THERMAL_TMP0_NS + idx; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ec_offset =3D TP_EC_THERMAL_TMP8_NS + (idx - 8); >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!acpi_e= c_read(ec_offset, &tmp)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 return -EIO; >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *value =3D = tmp * 1000; 1000 should likely be something from linux/units.h. --=20 i. --8323328-1463870039-1707404934=:1104--