From patchwork Tue Mar 21 09:04:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winiarska, Iwona" X-Patchwork-Id: 13182462 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB546C74A5B for ; Tue, 21 Mar 2023 09:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbjCUJF1 (ORCPT ); Tue, 21 Mar 2023 05:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbjCUJE4 (ORCPT ); Tue, 21 Mar 2023 05:04:56 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 505C1113FB; Tue, 21 Mar 2023 02:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679389466; x=1710925466; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=K/UpgIYLTihwD15Oud7TyDW4zGjAMXrk2MOqKYKZ9Vg=; b=CgAZb8z6KoQprNt94fbn8G51oNthpjbjA5qGZSLQcsJoLcoHrL5ofF6a oC1nmeWaABVXbLYR5Qt+1hx0tQXBYmn53XvEGGaqwEGcmE0ih3vgPQivZ cfPa47c97hpeHubfXAo7dJGuGlZfOrR7YHuyYEEEXEA9A6/ITD1crLXjg 0aomCoOUeBE/SUbGleaRkwJaqqvpl+F8+rJmOQx61Y2N7rlPd7JPcp3K7 MLUoOJykiD6shmaLUvC+z2OpT5veRhStQDODcFTh3DLO2WltmEXTgfpBi 1JnwuiOZP326UIWTujWnNQl4KepQFrVts+kxSH4ll3uqXL2VfPDODQ5U9 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="336392746" X-IronPort-AV: E=Sophos;i="5.98,278,1673942400"; d="scan'208";a="336392746" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 02:04:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="683787841" X-IronPort-AV: E=Sophos;i="5.98,278,1673942400"; d="scan'208";a="683787841" Received: from mhahn1-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.37.31]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 02:04:21 -0700 From: Iwona Winiarska To: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Paul Fertser , Guenter Roeck , Jean Delvare Cc: Andy Shevchenko , Iwona Winiarska Subject: [PATCH] hwmon: (peci/cputemp) Fix miscalculated DTS for SKX Date: Tue, 21 Mar 2023 10:04:10 +0100 Message-Id: <20230321090410.866766-1-iwona.winiarska@intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org For Skylake, DTS temperature of the CPU is reported in S10.6 format instead of S8.8. Reported-by: Paul Fertser Link: https://lore.kernel.org/lkml/ZBhHS7v+98NK56is@home.paul.comp/ Signed-off-by: Iwona Winiarska --- drivers/hwmon/peci/cputemp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/peci/cputemp.c b/drivers/hwmon/peci/cputemp.c index 30850a479f61..87d56f0fc888 100644 --- a/drivers/hwmon/peci/cputemp.c +++ b/drivers/hwmon/peci/cputemp.c @@ -537,6 +537,12 @@ static const struct cpu_info cpu_hsx = { .thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree, }; +static const struct cpu_info cpu_skx = { + .reg = &resolved_cores_reg_hsx, + .min_peci_revision = 0x33, + .thermal_margin_to_millidegree = &dts_ten_dot_six_to_millidegree, +}; + static const struct cpu_info cpu_icx = { .reg = &resolved_cores_reg_icx, .min_peci_revision = 0x40, @@ -558,7 +564,7 @@ static const struct auxiliary_device_id peci_cputemp_ids[] = { }, { .name = "peci_cpu.cputemp.skx", - .driver_data = (kernel_ulong_t)&cpu_hsx, + .driver_data = (kernel_ulong_t)&cpu_skx, }, { .name = "peci_cpu.cputemp.icx",