Re: [PATCH v2] hwmon: Driver for temperature sensors on SATA drives

From: Gabriel C
Date: Sun Jan 12 2020 - 08:46:11 EST


Am So., 12. Jan. 2020 um 14:07 Uhr schrieb Guenter Roeck <linux@xxxxxxxxxxxx>:
>
> On 1/12/20 4:07 AM, Linus Walleij wrote:
> > On Sun, Jan 12, 2020 at 1:03 PM Gabriel C <nix.or.die@xxxxxxxxx> wrote:
> >> Am So., 12. Jan. 2020 um 12:22 Uhr schrieb Linus Walleij
> >> <linus.walleij@xxxxxxxxxx>:
> >>>
> >>> On Sun, Jan 12, 2020 at 12:18 PM Gabriel C <nix.or.die@xxxxxxxxx> wrote:
> >>>
> >>>> What I've noticed however is the nvme temperature low/high values on
> >>>> the Sensors X are strange here.
> >>> (...)
> >>>> Sensor 1: +27.9ÂC (low = -273.1ÂC, high = +65261.8ÂC)
> >>>> Sensor 2: +29.9ÂC (low = -273.1ÂC, high = +65261.8ÂC)
> >>> (...)
> >>>> Sensor 1: +23.9ÂC (low = -273.1ÂC, high = +65261.8ÂC)
> >>>> Sensor 2: +25.9ÂC (low = -273.1ÂC, high = +65261.8ÂC)
> >>>
> >>> That doesn't look strange to me. It seems like reasonable defaults
> >>> from the firmware if either it doesn't really log the min/max temperatures
> >>> or hasn't been through a cycle of updating these yet. Just set both
> >>> to absolute min/max temperatures possible.
> >>
> >> Ok I'll check that.
> >>
> >> Do you mean by setting the temperatures to use a lmsensors config?
> >> Or is there a way to set these with a nvme command?
> >
> > Not that I know of.
> >
> > The min/max are the minumum and maximum temperatures the
> > device has experienced during this power-on cycle.
> >
>
> No, that would be lowest/highest. The above are (or should be) per-sensor
> setpoints. The default for those is typically the absolute minimum /
> maximum of the supported range.
>
> Some SATA drives report the lowest/highest temperatures experienced
> since power cycle, like here.
>
> drivetemp-scsi-5-0
> Adapter: SCSI adapter
> temp1: +23.0ÂC (low = +0.0ÂC, high = +60.0ÂC)
> (crit low = -41.0ÂC, crit = +85.0ÂC)
> (lowest = +20.0ÂC, highest = +31.0ÂC)
>

The SATA temperatures are fine and reported like this here too, just
the nvme ones are strange.

drivetemp-scsi-4-0
Adapter: SCSI adapter
temp1: +28.0ÂC (low = +1.0ÂC, high = +61.0ÂC)
(crit low = +2.0ÂC, crit = +60.0ÂC)
(lowest = +16.0ÂC, highest = +31.0ÂC)

drivetemp-scsi-12-0
Adapter: SCSI adapter
temp1: +29.0ÂC (low = +1.0ÂC, high = +61.0ÂC)
(crit low = +2.0ÂC, crit = +60.0ÂC)
(lowest = +18.0ÂC, highest = +32.0ÂC)

and so on.

Btw, where I can find the code does these calculations?

Best regards,

Gabriel C.