nvme-pci: add quirk for missing secondary temperature thresholds
authorHristo Venev <hristo@venev.name>
Tue, 25 Apr 2023 19:58:54 +0000 (22:58 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 3 May 2023 16:11:43 +0000 (18:11 +0200)
commitbd375feeaf3408ed00e08c3bc918d6be15f691ad
treec31dd90dd069bebca2bb2b7e3303b0d53f148605
parent1616d6c3717bae9041a4240d381ec56ccdaafedc
nvme-pci: add quirk for missing secondary temperature thresholds

On Kingston KC3000 and Kingston FURY Renegade (both have the same PCI
IDs) accessing temp3_{min,max} fails with an invalid field error (note
that there is no problem setting the thresholds for temp1).

This contradicts the NVM Express Base Specification 2.0b, page 292:

  The over temperature threshold and under temperature threshold
  features shall be implemented for all implemented temperature sensors
  (i.e., all Temperature Sensor fields that report a non-zero value).

Define NVME_QUIRK_NO_SECONDARY_TEMP_THRESH that disables the thresholds
for all but the composite temperature and set it for this device.

Signed-off-by: Hristo Venev <hristo@venev.name>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/hwmon.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c