From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8F4AC6FD1D for ; Mon, 20 Mar 2023 12:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=15Km05RPFqIaSRRTwNJk0zhUk+DwCg83BneDDiQ1HpI=; b=MyDcdbdZ4K7iEe J/nQeOxJItBsffjAWdQhv2u89YUheblgVuYWxdNIuiHDclDkt/B1coVJ5RuVfO4R4FL6uLbPqDRYr E0oWl04UwZQauFOtJzd2+jhnANZBZFbG2wo8rGVNgHV4PW2mJrdZhyCUrjxliT7Q34fvclbD6TV3I Wh7oqw1BQ0qj1WMsSLo/QYsvYx9VCcAmAsodUUnkKBQVpJPIEQas4YTgJfnoZGBHamIbOkx81CofC UbnujrRp6nmehb3wzKNsBOGauHjtTCtfWiug3WhFi8KKunSwX0Od3/m9SsPo5cY2F8K32wXakxNP+ xFJfvPmOvvRPSHSoTQjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1peEuo-00903K-01; Mon, 20 Mar 2023 12:47:06 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1peEuk-00902d-0p for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2023 12:47:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679316422; x=1710852422; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=BS/iDj084XvVXlM/TI4ORDgBbDzLSZq0yXe7n1ACXBA=; b=WERAoxlPimg+HOMM0GAQKmEv5/J10Dh1kHsboP0pEreh0OvzIEIq8c1+ k4wZtVWTzBSbLt7gUYMCoWuP+SSBAriC/LIRK3Pl4JSflqiTRiJXcrzhf SYmTYYmagfFmG3SXrN+wK8L2Ysv38ApPrO11UiplTM5fM1mmRfmjg1s0t m6UUsyKL8C/G3SJeql+JHCFfp0VafTFqDgKH5aacMhGxPtmvrfIJBwVXM 1KpU90mqmqwbRISwnSCjWrKu8+ufBALOpSdHTVyaJZOy3V9qwowLBQMgK 4f4ydq2wI/HwEvZEozrnxDaDbSp8x9y92sSkK6vGXPchbmKmZYRJbUM1I Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="319050910" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="319050910" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2023 05:46:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="745361757" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="745361757" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP; 20 Mar 2023 05:46:51 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1peEuW-006GkN-0C; Mon, 20 Mar 2023 14:46:48 +0200 Date: Mon, 20 Mar 2023 14:46:47 +0200 From: Andy Shevchenko To: Paul Fertser Cc: Iwona Winiarska , linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Greg Kroah-Hartman , linux-aspeed@lists.ozlabs.org, linux-doc@vger.kernel.org, Dave Hansen , Zev Weiss , Jae Hyun Yoo , Jonathan Corbet , Pierre-Louis Bossart , Guenter Roeck , devicetree@vger.kernel.org, Jean Delvare , Arnd Bergmann , Billy Tsai , Rob Herring , Borislav Petkov , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, Tony Luck , Andrew Jeffery , Randy Dunlap , Olof Johansson Subject: Re: [PATCH v8 10/13] hwmon: peci: Add cputemp driver Message-ID: References: <20220208153639.255278-1-iwona.winiarska@intel.com> <20220208153639.255278-11-iwona.winiarska@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230320_054702_310166_6BF29504 X-CRM114-Status: GOOD ( 19.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 20, 2023 at 02:45:15PM +0300, Paul Fertser wrote: > Hello, > > We are seeing wrong DTS temperatures on at least "Intel(R) Xeon(R) > Bronze 3204 CPU @ 1.90GHz" and most probably other Skylake Xeon CPUs > are also affected, see inline. Thanks for the report! I guess we need a fix for this indeed. > On Tue, Feb 08, 2022 at 04:36:36PM +0100, Iwona Winiarska wrote: > > Add peci-cputemp driver for Digital Thermal Sensor (DTS) thermal > > readings of the processor package and processor cores that are > > accessible via the PECI interface. > ... > > +static const struct cpu_info cpu_hsx = { > > + .reg = &resolved_cores_reg_hsx, > > + .min_peci_revision = 0x33, > > + .thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree, > > +}; > > + > > +static const struct cpu_info cpu_icx = { > > + .reg = &resolved_cores_reg_icx, > > + .min_peci_revision = 0x40, > > + .thermal_margin_to_millidegree = &dts_ten_dot_six_to_millidegree, > > +}; > ... > > + { > > + .name = "peci_cpu.cputemp.skx", > > + .driver_data = (kernel_ulong_t)&cpu_hsx, > > + }, > > With this configuration we get this data: > > /sys/bus/peci/devices/0-30/peci_cpu.cputemp.skx.48/hwmon/hwmon15# grep . temp[123]_{label,input} > temp1_label:Die > temp2_label:DTS > temp3_label:Tcontrol > temp1_input:30938 > temp2_input:67735 > temp3_input:80000 > > On the host system "sensors" report > > Package id 0: +31.C (high = +80.C, crit = +90.C) > > So I conclude Die temperature as retrieved over PECI is correct while > DTS is mis-calculated. The old downstream code in OpenBMC was using > ten_dot_six_to_millidegree() function for conversion, and that was > providing expected results. And indeed if we reverse the calculation > here we get 80000 - ((80000-67735) * 256 / 64) = 30940 which matches > expectations. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel