Message ID | 20230321090410.866766-1-iwona.winiarska@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1674176wrt; Tue, 21 Mar 2023 02:25:57 -0700 (PDT) X-Google-Smtp-Source: AK7set+jpM2NgWQjRrOUeXbouwmLY6M+x1Dq0vVdKOr3yE9qR9EhtHekqb8SUDKP1YDRh3PtZMQN X-Received: by 2002:a62:1ad6:0:b0:623:7340:3741 with SMTP id a205-20020a621ad6000000b0062373403741mr1446426pfa.23.1679390757552; Tue, 21 Mar 2023 02:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679390757; cv=none; d=google.com; s=arc-20160816; b=vb8s8PuzK8VGrfbO7L8SfPY1yFT9ioZVvvNaLNrJTf8gWR+vRUlh9qQaMvj6lf41pd +O4HDnbR8RBnNtsb2uyj/kDhpxoYZc/iKDd++nR9UO+yuxGxOm1cZsbe4GHo3Fux8bfv KtogLLQwgwLUw8SJfF1KUX5rGscs1/bKhF63NlIutgrO8NfE9uDG0EimeTPhB9gbwL9E Q/Z3bz0aD/z5F+8pRK/QgQhQqyjzOFJ1+KO4IZgIL6Oap43abJWOvsF0aw9CMt4raUm6 YYRSlZ11Obhe9mSHVXjDR3G8s/TvZ+eP95GLIC/Cy1MQ0cXYgtdZ6QIPgBgp1MpuU0fy 4Qlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ddtNpYrij6Idmqct/LQcmjf2VI3iL1G+r/mVNuyG+Ac=; b=iWrtA7qyhN3+4ASjqPoeYzRBowt9RlvlWvt07ZXZkgNZe95HnlPAbs4rpW6QYFf/jS i5/AfBmfPhMCz6LUP8PjmzgNX26eftWe3xRQEpTi4k6kXLKnSL1thW3Upw6y9WqQiPfA Qpbq0BnuikGH+m6WUSbmsEyEq732WR+H4FsFX4PekZEioe9vZxaJuXLN4JFI+iNo8ZrY fov553T1PyW1ETbF/vKKqleLf/v2BJhIUkIj2W7ORWwJB0Dpy+H/uQNMqITV4Hnn03lX 6Om6gRrlblwrSyDw/66Z3LOCGgNVGmBgqMDZCiCuKREJDnHjGA/IEOhYx1saCnt6+P5C r4mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CgAZb8z6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a62f24b000000b0062565210347si12538061pfl.275.2023.03.21.02.25.42; Tue, 21 Mar 2023 02:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CgAZb8z6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbjCUJF3 (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Tue, 21 Mar 2023 05:05:29 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <iwona.winiarska@intel.com> To: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Paul Fertser <fercerpav@gmail.com>, Guenter Roeck <linux@roeck-us.net>, Jean Delvare <jdelvare@suse.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Iwona Winiarska <iwona.winiarska@intel.com> 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760968843001767755?= X-GMAIL-MSGID: =?utf-8?q?1760968843001767755?= |
Series |
hwmon: (peci/cputemp) Fix miscalculated DTS for SKX
|
|
Commit Message
Winiarska, Iwona
March 21, 2023, 9:04 a.m. UTC
For Skylake, DTS temperature of the CPU is reported in S10.6 format
instead of S8.8.
Reported-by: Paul Fertser <fercerpav@gmail.com>
Link: https://lore.kernel.org/lkml/ZBhHS7v+98NK56is@home.paul.comp/
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
---
drivers/hwmon/peci/cputemp.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Comments
Dear Iwona, Am 21.03.23 um 10:04 schrieb Iwona Winiarska: > For Skylake, DTS temperature of the CPU is reported in S10.6 format > instead of S8.8. > > Reported-by: Paul Fertser <fercerpav@gmail.com> > Link: https://lore.kernel.org/lkml/ZBhHS7v+98NK56is@home.paul.comp/ > Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> > --- > 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, This is not aligned. Why not only use one space before the equal sign? > + .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", Kind regards, Paul
On Tue, 2023-03-21 at 10:41 +0100, Paul Menzel wrote: > Dear Iwona, > > > Am 21.03.23 um 10:04 schrieb Iwona Winiarska: > > For Skylake, DTS temperature of the CPU is reported in S10.6 format > > instead of S8.8. > > > > Reported-by: Paul Fertser <fercerpav@gmail.com> > > Link: https://lore.kernel.org/lkml/ZBhHS7v+98NK56is@home.paul.comp/ > > Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> > > --- > > 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, > > This is not aligned. Why not only use one space before the equal sign? Yeah - same alignment problem is present in cpu_hsx and cpu_icx though, so I just followed along for skx to not stand out visually. So while I agree that alignment is broken here, I think it might be better to separate out the potential cleanup from the fix. Thanks -Iwona > > > + .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", > > > Kind regards, > > Paul
On Tue, Mar 21, 2023 at 10:29:22AM +0000, Winiarska, Iwona wrote: > On Tue, 2023-03-21 at 10:41 +0100, Paul Menzel wrote: > > Am 21.03.23 um 10:04 schrieb Iwona Winiarska: ... > > This is not aligned. Why not only use one space before the equal sign? > > Yeah - same alignment problem is present in cpu_hsx and cpu_icx though, so I > just followed along for skx to not stand out visually. > So while I agree that alignment is broken here, I think it might be better to > separate out the potential cleanup from the fix. I agree with Iwona. If community wants a cleanup, it can be created in a separate patch. For the fixes it's better to reduce the unrelated churn.
On Tue, Mar 21, 2023 at 03:08:45PM +0200, andriy.shevchenko@linux.intel.com wrote: > On Tue, Mar 21, 2023 at 10:29:22AM +0000, Winiarska, Iwona wrote: > > On Tue, 2023-03-21 at 10:41 +0100, Paul Menzel wrote: > > > Am 21.03.23 um 10:04 schrieb Iwona Winiarska: > > ... > > > > This is not aligned. Why not only use one space before the equal sign? > > > > Yeah - same alignment problem is present in cpu_hsx and cpu_icx though, so I > > just followed along for skx to not stand out visually. > > So while I agree that alignment is broken here, I think it might be better to > > separate out the potential cleanup from the fix. > > I agree with Iwona. If community wants a cleanup, it can be created in > a separate patch. For the fixes it's better to reduce the unrelated churn. > I don't want a cleanup. The original author chose the alignment, I accepted it because I give submitters some slack when it comes to formatting as long as checkpatch doesn't complain, and I do not want to get into lets-change-alignment wars. Thanks, Guenter
On Tue, Mar 21, 2023 at 10:04:10AM +0100, Iwona Winiarska wrote: > For Skylake, DTS temperature of the CPU is reported in S10.6 format > instead of S8.8. > > Reported-by: Paul Fertser <fercerpav@gmail.com> > Link: https://lore.kernel.org/lkml/ZBhHS7v+98NK56is@home.paul.comp/ > Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Applied. Thanks, Guenter > --- > 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",
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",