Message ID | 20230218115318.20662-2-W_Armin@gmx.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp343309wrn; Sat, 18 Feb 2023 04:11:14 -0800 (PST) X-Google-Smtp-Source: AK7set8j06HqFDbtvzD+3boAZ98hgkqnfWXF7OPbiGWdMvRSuT8tXIC+eYk6T0QIuS4/SAC2zG6A X-Received: by 2002:a17:907:c927:b0:8b2:7150:dd03 with SMTP id ui39-20020a170907c92700b008b27150dd03mr4548530ejc.35.1676722274209; Sat, 18 Feb 2023 04:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676722274; cv=none; d=google.com; s=arc-20160816; b=mcTN7UMwfsm234/8e9Vbl/UoUbqFDaa6/7+TMQy86foNP19bIv8C/73ruiRI61HuH1 fSMh55Fi8o+CS6UV3js1nlzajdo/XyvyuS92Ti3tfK+A7435L4raczfMfnmyTT7rKjC7 j+hEh17nsd52MgOjrdJayBrqZgpA7emms/RMi4buq6E4YCUrdpXkz36bKnmYPMemRDin UuwFUdNv9SbQqyqmxX75nbD+CQg4+kbEl9KvP8fVMCmD/6e3qzUtytmdLItU6yuw4Xn/ 3ZNhml2vIq5vj55jmvyYMX98+7nYc17NPSIbW626x40n5dM4EZp64yieUQG1eRkVNNJq r8iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+LlDqOMaxsWq/lmlne2eskRmpz8VeiLZYPQq+WkuXaY=; b=IE6L8cCxADpzpNFe7RfChzer93gtRP97dLIJ4MCJsI5wyy7q5/1ieKTIgl/KT2a3IW Mg3GX/gTjFDDNXkQCLrBX+g81z8YaYjiTab2tKsGA2tbqGxNGyQdorEJZ6IhBB6zGHcP OUTcOftX5yua4Ox7GOAmcqED7PrTFv7A3iYAqrfFObFSTjOVjtdWapYtzX6BYxhhQZSO MhIk4SJ07Yx20VmeNS12oL2/Y3g+fg5W9dLXQkDqqAI48mgd8fd+Y3A6QTC5OBpHUNxF VVY8b8ee0sz/rCxQjjCygmCEEsusMr6tTFyzF3+6rV933LUxzMF3nGFY+Z1dafYUrgTk vwuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=nKjGxFVa; 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=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a170906004e00b008af3fd67d4bsi9604844ejg.651.2023.02.18.04.10.47; Sat, 18 Feb 2023 04:11:14 -0800 (PST) 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=@gmx.de header.s=s31663417 header.b=nKjGxFVa; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbjBRLx6 (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Sat, 18 Feb 2023 06:53:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbjBRLxz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 18 Feb 2023 06:53:55 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D924F18158; Sat, 18 Feb 2023 03:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1676721207; i=w_armin@gmx.de; bh=QPjZNlJU4QJ41mwOkCGDhNx04tR/f7ULkAR65bMgRBE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=nKjGxFVawnebHNAYS2FFFcwbyNCrcCeqKOgaSTS7E1jsD4tSgossVDuwOB8eOEF0o UybTERZcm5gAvVXSanYE2Jhvn4A1tCnFsWInmRSXnio9+bt8H4YAKdbPhe9aUSYhSG eflUpGZkj22FsQgeuZ6Z9TcZ5MMzYXlB8gfWbbKS54gDgzvjVE206H0tUdneNv91Fz yJWMlDEJGm2EmIeMJWK5MI3XjjN3W6HHfSTHQjepqvZOY7PLpK/RZUxwUzB93fDiq3 tk/l6tX3HcvhY8ActknHRb1K5nxRIVJbrLCiN2wDCCTbyjCxM/8L1pw7p1YC38XfiR z7ItDAfoMsh3Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from esprimo-mx.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M2O6Y-1pXBnd2nQE-003yMD; Sat, 18 Feb 2023 12:53:27 +0100 From: Armin Wolf <W_Armin@gmx.de> To: hdegoede@redhat.com, markgross@kernel.org Cc: jdelvare@suse.com, linux@roeck-us.net, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] platform/x86: dell-ddv: Fix temperature scaling Date: Sat, 18 Feb 2023 12:53:18 +0100 Message-Id: <20230218115318.20662-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230218115318.20662-1-W_Armin@gmx.de> References: <20230218115318.20662-1-W_Armin@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-print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U+LMZuiILbk3mcQUJPbxRmix NLs6TrcFL7pN4z0fqa55Bwui6ZhJhxIYPxby0VQJD67Fg4p/UwETIKxksLwmGyjcmrPIh8Tke asux1LqZBd36RLspqpkTZa9yoCbxXnQ1g3vtOQHifKwkbBuApNlpBQHvtlMXAACaGAG8dbojF JN+PLJTLi7vvjZL36elEu984UrE= X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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?1758170735032858378?= X-GMAIL-MSGID: =?utf-8?q?1758170735032858378?= |
Series |
[v2,1/2] platform/x86: dell-ddv: Fix cache invalidation on resume
|
|
Commit Message
Armin Wolf
Feb. 18, 2023, 11:53 a.m. UTC
After using the built-in UEFI hardware diagnostics to compare
the measured battery temperature, i noticed that the temperature
is actually expressed in tenth degree kelvin, similar to the
SBS-Data standard. For example, a value of 2992 is displayed as
26 degrees celsius.
Fix the scaling so that the correct values are being displayed.
Tested on a Dell Inspiron 3505.
Fixes: a77272c16041 ("platform/x86: dell: Add new dell-wmi-ddv driver")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
Changes in v2:
- Avoid unnecessary rounding
---
drivers/platform/x86/dell/dell-wmi-ddv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.30.2
Comments
Hi, On 2/18/23 12:53, Armin Wolf wrote: > After using the built-in UEFI hardware diagnostics to compare > the measured battery temperature, i noticed that the temperature > is actually expressed in tenth degree kelvin, similar to the > SBS-Data standard. For example, a value of 2992 is displayed as > 26 degrees celsius. > Fix the scaling so that the correct values are being displayed. > > Tested on a Dell Inspiron 3505. > > Fixes: a77272c16041 ("platform/x86: dell: Add new dell-wmi-ddv driver") > Signed-off-by: Armin Wolf <W_Armin@gmx.de> Thanks, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans I'll rebase that branch once 6.3-rc1 is out and then push the rebased patch to the fixes branch and include it in my next 6.3 fixes pull-req to Linus. Regards, Hans > --- > Changes in v2: > - Avoid unnecessary rounding > --- > drivers/platform/x86/dell/dell-wmi-ddv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c > index eff4e9649faf..2750dee99c3e 100644 > --- a/drivers/platform/x86/dell/dell-wmi-ddv.c > +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c > @@ -17,7 +17,6 @@ > #include <linux/kernel.h> > #include <linux/hwmon.h> > #include <linux/kstrtox.h> > -#include <linux/math.h> > #include <linux/math64.h> > #include <linux/module.h> > #include <linux/mutex.h> > @@ -665,7 +664,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char > if (ret < 0) > return ret; > > - return sysfs_emit(buf, "%d\n", DIV_ROUND_CLOSEST(value, 10)); > + /* Use 2731 instead of 2731.5 to avoid unnecessary rounding */ > + return sysfs_emit(buf, "%d\n", value - 2731); > } > > static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf) > -- > 2.30.2 >
diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c index eff4e9649faf..2750dee99c3e 100644 --- a/drivers/platform/x86/dell/dell-wmi-ddv.c +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c @@ -17,7 +17,6 @@ #include <linux/kernel.h> #include <linux/hwmon.h> #include <linux/kstrtox.h> -#include <linux/math.h> #include <linux/math64.h> #include <linux/module.h> #include <linux/mutex.h> @@ -665,7 +664,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char if (ret < 0) return ret; - return sysfs_emit(buf, "%d\n", DIV_ROUND_CLOSEST(value, 10)); + /* Use 2731 instead of 2731.5 to avoid unnecessary rounding */ + return sysfs_emit(buf, "%d\n", value - 2731); } static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf)