Page MenuHomeFreeBSD

nvme: fix wrong temperature unit for INTEL SSDs.
ClosedPublic

Authored by wanpengqian_gmail.com on Nov 5 2021, 5:13 AM.
Tags
None
Referenced Files
F103811024: D32845.diff
Fri, Nov 29, 6:08 PM
Unknown Object (File)
Fri, Nov 1, 12:29 AM
Unknown Object (File)
Sep 19 2024, 5:16 PM
Unknown Object (File)
Sep 9 2024, 10:14 AM
Unknown Object (File)
Sep 4 2024, 10:23 AM
Unknown Object (File)
Aug 30 2024, 2:16 AM
Unknown Object (File)
Aug 30 2024, 2:16 AM
Unknown Object (File)
Aug 30 2024, 2:05 AM
Subscribers

Details

Summary

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>

Test Plan

output intel's logpage and check the result.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42599
Build 39487: arc lint + arc unit

Event Timeline

Can you update this revision to add a 'Signed-off-by:' line so I can get the author right? This is ready to land otherwise.

This revision is now accepted and ready to land.Nov 5 2021, 3:16 PM

Does smartctl have code that does different things for different models?
When I wrote this, I was sure the numbers were right for the drives at the time (a few years ago, and it may have been against an engineering sample).

In D32845#765360, @imp wrote:

Does smartctl have code that does different things for different models?
When I wrote this, I was sure the numbers were right for the drives at the time (a few years ago, and it may have been against an engineering sample).

all my intel nvme ssds, p3700, p3600, optane m10 show same results.
I also check linux nvme-cli code, here
https://github.com/linux-nvme/nvme-cli/blob/master/plugins/intel/intel-nvme.c
only intel does not subtract 273, other brand, when output temp, subtract 273.

In D32845#765360, @imp wrote:

Does smartctl have code that does different things for different models?
When I wrote this, I was sure the numbers were right for the drives at the time (a few years ago, and it may have been against an engineering sample).

all my intel nvme ssds, p3700, p3600, optane m10 show same results.
I also check linux nvme-cli code, here
https://github.com/linux-nvme/nvme-cli/blob/master/plugins/intel/intel-nvme.c
only intel does not subtract 273, other brand, when output temp, subtract 273.

Great! Works for me.

@corvink Can you please help me verify if this patch solve the issue? it needs an Intel SSD for verifying.

@corvink Can you please help me verify if this patch solve the issue? it needs an Intel SSD for verifying.

The patch looks good to me. Sadly, I have no access to an Intel SSD. Maybe you can provide some links to other tools. If they have the same behaviour (use value for Intel and subtract 273 from value for other brands), this patch should be fine.

Minor tweak needed for samsung.c, which I did before pushing.

Also, sorry I let this linger for so long... it's been a busy year.