]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nvmecontrol: fix wrong temperature unit for INTEL SSDs.
authorWanpeng Qian <wanpengqian@gmail.com>
Fri, 11 Nov 2022 19:13:06 +0000 (12:13 -0700)
committerWarner Losh <imp@FreeBSD.org>
Fri, 11 Nov 2022 19:15:52 +0000 (12:15 -0700)
commit3a194eac3c992c5d7c72ff512aa3b475f64ac579
tree1ffe5c4946d0534b7b13588745d9c53597a44a44
parent03d6764b384e64c0e812c1a1b9b19c0e0d45cde2
nvmecontrol: fix wrong temperature unit for INTEL SSDs.

Although intel's specification did not tell which unit for Temperature
Statistics (Log Identifier C5h), I believe it is based on Celsius
instead of Kelvin.

here is my P3700 SSDs result(before):

Intel Temperature Log
=====================
Current:                        30 K, -243.15 C, -405.67 F
Overtemp Last Flags             0
Overtemp Lifetime Flags         0
Max Temperature                 53 K, -220.15 C, -364.27 F
Min Temperature                 17 K, -256.15 C, -429.07 F
Max Operating Temperature       63 K, -210.15 C, -346.27 F
Min Operating Temperature       0 K, -273.15 C, -459.67 F
Estimated Temperature Offset:   0 C/K
after apply the patch, result is

Intel Temperature Log
=====================
Current:                        303.15 K, 30 C, 86.00 F
Overtemp Last Flags             0
Overtemp Lifetime Flags         0
Max Temperature                 326.15 K, 53 C, 127.40 F
Min Temperature                 290.15 K, 17 C, 62.60 F
Max Operating Temperature       336.15 K, 63 C, 145.40 F
Min Operating Temperature       273.15 K, 0 C, 32.00 F
Estimated Temperature Offset:   0 C/K
I also compare to smartctl's report. it match very well.

also tested on Intel P3600, it fixed the problem.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by: imp (added tweak to samsung.c so it still compiles)
Differential Revision: https://reviews.freebsd.org/D32845
sbin/nvmecontrol/logpage.c
sbin/nvmecontrol/modules/intel/intel.c
sbin/nvmecontrol/modules/samsung/samsung.c
sbin/nvmecontrol/nvmecontrol.h