summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/hwmon.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2019-11-15 00:40:01 +0900
committerKeith Busch <kbusch@kernel.org>2019-11-22 02:21:08 +0900
commit6c6aa2f26c6813af38d88718881c0307bb9a54c0 (patch)
tree7991aa6e3616c743d5583cd77a04301c1135c4f9 /drivers/nvme/host/hwmon.c
parent52deba0f02a98c150677a9c381cc1991a928bcff (diff)
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 <linux@roeck-us.net> Cc: Keith Busch <kbusch@kernel.org> Cc: Jens Axboe <axboe@fb.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Sagi Grimberg <sagi@grimberg.me> Cc: Jean Delvare <jdelvare@suse.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme/host/hwmon.c')
-rw-r--r--drivers/nvme/host/hwmon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/nvme/host/hwmon.c b/drivers/nvme/host/hwmon.c
index 97a84b4b45db..a5af21f5d370 100644
--- a/drivers/nvme/host/hwmon.c
+++ b/drivers/nvme/host/hwmon.c
@@ -170,8 +170,12 @@ static umode_t nvme_hwmon_is_visible(const void *_data,
case hwmon_temp_max:
case hwmon_temp_min:
if ((!channel && data->ctrl->wctemp) ||
- (channel && data->log.temp_sensor[channel - 1]))
+ (channel && data->log.temp_sensor[channel - 1])) {
+ if (data->ctrl->quirks &
+ NVME_QUIRK_NO_TEMP_THRESH_CHANGE)
+ return 0444;
return 0644;
+ }
break;
case hwmon_temp_alarm:
if (!channel)