Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1300924rwb; Fri, 19 Aug 2022 00:50:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR54b/d7bl8CeHyX7rvdeCXjYNR6NehnuJyER2m3oOGqMyARW6702p65ZS/aNUB9yP3rA3Be X-Received: by 2002:a17:907:3f0a:b0:730:994f:8d57 with SMTP id hq10-20020a1709073f0a00b00730994f8d57mr4046984ejc.538.1660895446572; Fri, 19 Aug 2022 00:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660895446; cv=none; d=google.com; s=arc-20160816; b=bQ2uvmEuvyVSUCINSHHN/VD85iGkbxDoZPGzQ18cLTb21yGUn2y1uRbvgigNYg1yq4 FQoQmmtX30NOUPLM8kSCVsb7Kvn8IeJD63fgIEzp9FWZtBndxHwvy35hVifajq4cS29n jaFTJg98Og2NAWt9Rm0k0GgXqH0CCd4tajii77g/8NIcEW0ZjZfBv3F5Vwg0p6z67Ue4 Or0u/YZ9ykZ0k7INBS83rmMxuJlHPVtJfH9nhKSFmMfNohWNfM5H+nxrCzuqt58/SYgi XpzwKAlaBRc9CCzxw1gjfbeDbSgpDKHXNO0wkPYIokF21ao82DOE/d8kz1nF+nmV/eiX KJ1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:subject:dkim-signature; bh=d6POj7xk4cTUM5maaIYL0lltQRs3YIiqOu1HB6fBHwA=; b=ry89gkMxYcJQi+iTadc2J6nqc2ehlgBpiyey/DUGmk1dpQhFeQjAlWJVRaVJE84x4d omHzfeG8IgiRwOM6PvGCA7udEfma9LhcMKDyoq0SlQC/MDpi2rpk/agLRIuC+bLweQmL nnFqsGJUes03n4NywAnz33pDGQ2GkXTI00uEqIyXCb+2KcUGUryFwYLEzDNhATKg08aW ubt8iPkIFUQnuuuvNhcKaSsLbnu5cUI5GYDDaqxbasO4PU1xZOtfAyNlG+S4Dhl7UWfn +z6o/JSg0TUZBGu1LRAllTqK9wt3LoCCcKZj5Jwe1T/wuldqhOCJhr9bJ+ptJnE289KB nRCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=rPk5xxsc; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd38-20020a17090762a600b0073beb1b8f96si2608653ejc.234.2022.08.19.00.50.20; Fri, 19 Aug 2022 00:50:46 -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=@amazon.com header.s=amazon201209 header.b=rPk5xxsc; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347178AbiHSHoa (ORCPT + 99 others); Fri, 19 Aug 2022 03:44:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346854AbiHSHo1 (ORCPT ); Fri, 19 Aug 2022 03:44:27 -0400 Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B206CE49F; Fri, 19 Aug 2022 00:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1660895065; x=1692431065; h=message-id:date:mime-version:to:cc:references:from: in-reply-to:content-transfer-encoding:subject; bh=d6POj7xk4cTUM5maaIYL0lltQRs3YIiqOu1HB6fBHwA=; b=rPk5xxschdGTpwooa7mS9mgVIAiGDjr0NjN3xAw+d5wtrikE5G83bNaW XMX2l/2BsZ92clbBfMJ+Xqo/QMk12AptaUfbpBKH3pFQWYfM04o3lwbfk ncqiR9X+6P/oYT2T7YLWEnNqgmfThONZVKf5nCn6M2FdU0rbN9MUP7Ve1 E=; X-IronPort-AV: E=Sophos;i="5.93,247,1654560000"; d="scan'208";a="231469330" Subject: Re: [PATCH v2 12/16] hwmon: (mr75203) modify the temperature equation Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-92ba9394.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2022 07:44:13 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2a-92ba9394.us-west-2.amazon.com (Postfix) with ESMTPS id 0246745143; Fri, 19 Aug 2022 07:44:13 +0000 (UTC) Received: from EX19D013UWA003.ant.amazon.com (10.13.138.202) by EX13MTAUWA001.ant.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Fri, 19 Aug 2022 07:44:12 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX19D013UWA003.ant.amazon.com (10.13.138.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.12; Fri, 19 Aug 2022 07:44:12 +0000 Received: from [192.168.95.21] (10.85.143.173) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1497.38 via Frontend Transport; Fri, 19 Aug 2022 07:44:07 +0000 Message-ID: <2cc79934-2280-79e6-6e63-0e3eb7107e1c@amazon.com> Date: Fri, 19 Aug 2022 10:44:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Content-Language: en-US To: Guenter Roeck CC: , , , , , , , , , , , , , , , , , , "Farber, Eliav" References: <20220817054321.6519-1-farbere@amazon.com> <20220817054321.6519-13-farbere@amazon.com> <20220818202324.GA3431316@roeck-us.net> From: "Farber, Eliav" In-Reply-To: <20220818202324.GA3431316@roeck-us.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_SPF_WL 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: X-Mailing-List: linux-kernel@vger.kernel.org On 8/18/2022 11:23 PM, Guenter Roeck wrote: > On Wed, Aug 17, 2022 at 05:43:17AM +0000, Eliav Farber wrote: >> Modify the equation and coefficients to convert the digital output to >> temperature according to series 5 of the Moortec Embedded Temperature >> Sensor (METS) datasheet: >> T = G + H * (n / cal5 - 0.5) + J * F >> >> The G, H and J coefficients are multiplied by 1000 to get the >> temperature >> in milli-Celsius. >> > > This is, at the very least, confusing. It doesn't explain the discrepancy > to the old code nor the change in constant values. I have no idea if this > change would result in erroneous readings on some other system where > the existing calculation may be the correct one. When I tested the driver it was also not clear to me why the equation and coefficients in the code don't match the specifications in the data sheet. I reached out to Maxlinear engineers (@rtanwar) and they also couldn't explain the discrepancy. After further correspondence I aligned both the equation and coefficients in the driver code to the equation and coefficients defined in series 5 of the Moortec Embedded Temperature Sensor (METS) datasheet which they provided. > On top of that, it seems overflow-prune in 32 bit systems. I'll check if it can overflow, and if it can I'll fix in next version. -- Regards, Eliav