Skip to content

Commit 6c6aa2f

Browse files
mitakeithbusch
authored andcommitted
nvme: hwmon: add quirk to avoid changing temperature threshold
This adds a new quirk NVME_QUIRK_NO_TEMP_THRESH_CHANGE to avoid changing the value of the temperature threshold feature for specific devices that show undesirable behavior. Guenter reported: "On my Intel NVME drive (SSDPEKKW512G7), writing any minimum limit on the Composite temperature sensor results in a temperature warning, and that warning is sticky until I reset the controller. It doesn't seem to matter which temperature I write; writing -273000 has the same result." The Intel NVMe has the latest firmware version installed, so this isn't a problem that was ever fixed. Reported-by: Guenter Roeck <[email protected]> Cc: Keith Busch <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Jean Delvare <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 52deba0 commit 6c6aa2f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

drivers/nvme/host/hwmon.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,12 @@ static umode_t nvme_hwmon_is_visible(const void *_data,
170170
case hwmon_temp_max:
171171
case hwmon_temp_min:
172172
if ((!channel && data->ctrl->wctemp) ||
173-
(channel && data->log.temp_sensor[channel - 1]))
173+
(channel && data->log.temp_sensor[channel - 1])) {
174+
if (data->ctrl->quirks &
175+
NVME_QUIRK_NO_TEMP_THRESH_CHANGE)
176+
return 0444;
174177
return 0644;
178+
}
175179
break;
176180
case hwmon_temp_alarm:
177181
if (!channel)

drivers/nvme/host/nvme.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ enum nvme_quirks {
114114
* Prevent tag overlap between queues
115115
*/
116116
NVME_QUIRK_SHARED_TAGS = (1 << 13),
117+
118+
/*
119+
* Don't change the value of the temperature threshold feature
120+
*/
121+
NVME_QUIRK_NO_TEMP_THRESH_CHANGE = (1 << 14),
117122
};
118123

119124
/*

drivers/nvme/host/pci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3065,7 +3065,8 @@ static const struct pci_device_id nvme_id_table[] = {
30653065
NVME_QUIRK_DEALLOCATE_ZEROES, },
30663066
{ PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */
30673067
.driver_data = NVME_QUIRK_NO_DEEPEST_PS |
3068-
NVME_QUIRK_MEDIUM_PRIO_SQ },
3068+
NVME_QUIRK_MEDIUM_PRIO_SQ |
3069+
NVME_QUIRK_NO_TEMP_THRESH_CHANGE },
30693070
{ PCI_VDEVICE(INTEL, 0xf1a6), /* Intel 760p/Pro 7600p */
30703071
.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
30713072
{ PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */

0 commit comments

Comments
 (0)