Skip to content

Commit bd375fe

Browse files
hvenevChristoph Hellwig
authored andcommitted
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 <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 1616d6c commit bd375fe

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

drivers/nvme/host/hwmon.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ static umode_t nvme_hwmon_is_visible(const void *_data,
163163
case hwmon_temp_max:
164164
case hwmon_temp_min:
165165
if ((!channel && data->ctrl->wctemp) ||
166-
(channel && data->log->temp_sensor[channel - 1])) {
166+
(channel && data->log->temp_sensor[channel - 1] &&
167+
!(data->ctrl->quirks &
168+
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH))) {
167169
if (data->ctrl->quirks &
168170
NVME_QUIRK_NO_TEMP_THRESH_CHANGE)
169171
return 0444;

drivers/nvme/host/nvme.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ enum nvme_quirks {
149149
* Reports garbage in the namespace identifiers (eui64, nguid, uuid).
150150
*/
151151
NVME_QUIRK_BOGUS_NID = (1 << 18),
152+
153+
/*
154+
* No temperature thresholds for channels other than 0 (Composite).
155+
*/
156+
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19),
152157
};
153158

154159
/*

drivers/nvme/host/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,6 +3401,8 @@ static const struct pci_device_id nvme_id_table[] = {
34013401
.driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
34023402
{ PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */
34033403
.driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
3404+
{ PCI_DEVICE(0x2646, 0x5013), /* Kingston KC3000, Kingston FURY Renegade */
3405+
.driver_data = NVME_QUIRK_NO_SECONDARY_TEMP_THRESH, },
34043406
{ PCI_DEVICE(0x2646, 0x5018), /* KINGSTON OM8SFP4xxxxP OS21012 NVMe SSD */
34053407
.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
34063408
{ PCI_DEVICE(0x2646, 0x5016), /* KINGSTON OM3PGP4xxxxP OS21011 NVMe SSD */

0 commit comments

Comments
 (0)