[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <01dc687a-f61e-2ca9-4117-83cb91454848@applied-asynchrony.com>
Date: Tue, 24 Sep 2019 16:55:27 +0200
From: Holger Hoffstätte <holger@...lied-asynchrony.com>
To: Igor Russkikh <Igor.Russkikh@...antia.com>,
Netdev <netdev@...r.kernel.org>
Subject: Re: atlantic: weird hwmon temperature readings with AQC107 NIC
(kernel 5.2/5.3)
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 <holger@...lied-asynchrony.com>
Thanks again for the quick help!
Holger
Powered by blists - more mailing lists