All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ndctl, list: add controller temperature threshold
@ 2018-06-25  8:42 QI Fuli
  2018-06-25 20:09 ` Verma, Vishal L
  0 siblings, 1 reply; 3+ messages in thread
From: QI Fuli @ 2018-06-25  8:42 UTC (permalink / raw)
  To: linux-nvdimm

This patch adds controller temperature threshold to list.
When the dimm-controller-temperature event fires, users need to know
the current controller temperature threshold value.

Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com>
---
 ndctl/util/json-smart.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ndctl/util/json-smart.c b/ndctl/util/json-smart.c
index 9482b35..d590b0c 100644
--- a/ndctl/util/json-smart.c
+++ b/ndctl/util/json-smart.c
@@ -47,6 +47,18 @@ static void smart_threshold_to_json(struct ndctl_dimm *dimm,
 					"temperature_threshold", jobj);
 	}
 
+	if (alarm_control & ND_SMART_TEMP_TRIP) {
+		unsigned int temp;
+		double t;
+
+		temp = ndctl_cmd_smart_threshold_get_ctrl_temperature(cmd);
+		t = ndctl_decode_smart_temperature(temp);
+		jobj = json_object_new_double(t);
+		if (jobj)
+			json_object_object_add(jhealth,
+				"controller_temperature_threshold", jobj);
+	}
+
 	if (alarm_control & ND_SMART_SPARE_TRIP) {
 		unsigned int spares;
 
-- 
2.17.1


_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2018-06-25 23:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25  8:42 [PATCH] ndctl, list: add controller temperature threshold QI Fuli
2018-06-25 20:09 ` Verma, Vishal L
2018-06-25 23:55   ` Qi, Fuli

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.