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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:09 +0000 (10:34 +0200)
commit7d98a36b101f2d753dcf734208851db0bd3e6242
tree650f0c4f7bf76b9050bd7e67907a1e3a7f10f6c7
parent53786bfadc4371ba163b3292bb39713baf55a54f
nvme-pci: add quirk for missing secondary temperature thresholds

[ Upstream commit bd375feeaf3408ed00e08c3bc918d6be15f691ad ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/hwmon.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c