All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-hwmon: drop not common HWMON_T_MIN and HWMON_T_MAX
@ 2021-03-13  8:32 wangyugui
  2021-03-13 15:32 ` Guenter Roeck
  0 siblings, 1 reply; 6+ messages in thread
From: wangyugui @ 2021-03-13  8:32 UTC (permalink / raw)
  To: linux-hwmon; +Cc: dwagner, hare, wangyugui

HWMON_T_MIN is not common in NVMe SSD, so drop all of them in nvme-hwmon.

HWMON_T_MAX is only common in NVMe SSD Composite sensor, so drop them in other sensors.

Before this patch(SSD: PM1733):
#sensors
nvme-pci-4300
Adapter: PCI adapter
Composite:    +49.9°C  (low  = -273.1°C, high = +71.8°C)
                       (crit = +84.8°C)
Sensor 1:     +47.9°C  (low  = -273.1°C, high = +65261.8°C)
ERROR: Can't get value of subfeature temp3_min: I/O error
ERROR: Can't get value of subfeature temp3_max: I/O error
Sensor 2:     +49.9°C  (low  =  +0.0°C, high =  +0.0°C)

# cat /sys/class/nvme/nvme0/hwmon1/temp3_min
cat: /sys/class/nvme/nvme0/hwmon1/temp3_min: Input/output error
# cat /sys/class/nvme/nvme0/hwmon1/temp3_max
cat: /sys/class/nvme/nvme0/hwmon1/temp3_max: Input/output error

After this patch(SSD: PM1733):
#sensors
nvme-pci-4300
Adapter: PCI adapter
Composite:    +48.9°C  (high = +71.8°C, crit = +84.8°C)
Sensor 1:     +46.9°C
Sensor 2:     +48.9°C

---
 drivers/nvme/host/hwmon.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/nvme/host/hwmon.c b/drivers/nvme/host/hwmon.c
index 552dbc0..a93612f 100644
--- a/drivers/nvme/host/hwmon.c
+++ b/drivers/nvme/host/hwmon.c
@@ -188,23 +188,23 @@ static umode_t nvme_hwmon_is_visible(const void *_data,
 static const struct hwmon_channel_info *nvme_hwmon_info[] = {
 	HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
 	HWMON_CHANNEL_INFO(temp,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT | HWMON_T_MAX |
 				HWMON_T_CRIT | HWMON_T_LABEL | HWMON_T_ALARM,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL,
-			   HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN |
+			   HWMON_T_INPUT |
 				HWMON_T_LABEL),
 	NULL
 };
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-14 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-13  8:32 [PATCH] nvme-hwmon: drop not common HWMON_T_MIN and HWMON_T_MAX wangyugui
2021-03-13 15:32 ` Guenter Roeck
2021-03-13 22:44   ` Wang Yugui
2021-03-14  0:22     ` Guenter Roeck
2021-03-14 15:51       ` Wang Yugui
2021-03-14 18:04         ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.