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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5113CC432C1 for ; Tue, 24 Sep 2019 14:55:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EAC7207FD for ; Tue, 24 Sep 2019 14:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441417AbfIXOz3 (ORCPT ); Tue, 24 Sep 2019 10:55:29 -0400 Received: from mail.itouring.de ([188.40.134.68]:53686 "EHLO mail.itouring.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729134AbfIXOz3 (ORCPT ); Tue, 24 Sep 2019 10:55:29 -0400 Received: from tux.wizards.de (pD9EBF359.dip0.t-ipconnect.de [217.235.243.89]) by mail.itouring.de (Postfix) with ESMTPSA id 65F60416A471; Tue, 24 Sep 2019 16:55:27 +0200 (CEST) Received: from [192.168.100.223] (ragnarok.applied-asynchrony.com [192.168.100.223]) by tux.wizards.de (Postfix) with ESMTP id 33BB8F01602; Tue, 24 Sep 2019 16:55:27 +0200 (CEST) Subject: Re: atlantic: weird hwmon temperature readings with AQC107 NIC (kernel 5.2/5.3) To: Igor Russkikh , Netdev References: <0db14339-1b69-8fa4-21fd-6d436037c945@applied-asynchrony.com> <4faf7584-860e-6f52-95ab-ea96438af394@applied-asynchrony.com> From: =?UTF-8?Q?Holger_Hoffst=c3=a4tte?= Organization: Applied Asynchrony, Inc. Message-ID: <01dc687a-f61e-2ca9-4117-83cb91454848@applied-asynchrony.com> Date: Tue, 24 Sep 2019 16:55:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 9/24/19 4:32 PM, Igor Russkikh wrote: > We've recently found out that as well, could you try applying the following patch: > > diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c > b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c > index da726489e3c8..08b026b41571 100644 > --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c > +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c > @@ -337,7 +337,7 @@ static int aq_fw2x_get_phy_temp(struct aq_hw_s *self, int *temp) > /* Convert PHY temperature from 1/256 degree Celsius > * to 1/1000 degree Celsius. > */ > - *temp = temp_res * 1000 / 256; > + *temp = (temp_res & 0xFFFF) * 1000 / 256; > > return 0; > } Well, what do you know! eth0-pci-0600 Adapter: PCI adapter PHY Temperature: +63.5°C This looks like it aligns with reality. :-) > Funny thing is that this value gets readout from HW memory, all the readouts are > done by full dwords, but the value is only word width. High word of that dword I suspected upper-word-garbage but of course don't know internals. > is estimated cable length. On short cables we use it is often zero ;) :D When you send the proper patch feel free to add: Tested-by: Holger Hoffstätte Thanks again for the quick help! Holger