nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: QI Fuli <qi.fuli@jp.fujitsu.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH] ndctl, inject-smart: add an interface to inject ctrl-temperature
Date: Tue, 31 Jul 2018 21:18:42 +0900	[thread overview]
Message-ID: <20180731121842.27213-1-qi.fuli@jp.fujitsu.com> (raw)

This patch is used to add an interface to inject controller temperature.
The ndctl should be supportive of injecting all possible fields.
Although currently controller temperature injection is not supported
by NVDIMMs, this interface can return a failure report to users.

Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com>
---
 ndctl/inject-smart.c   | 1 +
 ndctl/lib/libndctl.sym | 1 +
 ndctl/lib/private.h    | 1 +
 ndctl/lib/smart.c      | 1 +
 ndctl/libndctl.h       | 2 ++
 5 files changed, 6 insertions(+)

diff --git a/ndctl/inject-smart.c b/ndctl/inject-smart.c
index f5a3a6f..56c39ab 100644
--- a/ndctl/inject-smart.c
+++ b/ndctl/inject-smart.c
@@ -392,6 +392,7 @@ static int smart_inject(struct ndctl_dimm *dimm)
 	int rc = -EOPNOTSUPP;
 
 	send_inject_val(media_temperature)
+	send_inject_val(ctrl_temperature)
 	send_inject_val(spares)
 	send_inject_bool(fatal)
 	send_inject_bool(unsafe_shutdown)
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 9b36960..fae24f0 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -375,4 +375,5 @@ global:
 	ndctl_dimm_get_flags;
 	ndctl_dimm_get_event_flags;
 	ndctl_dimm_is_flag_supported;
+	ndctl_cmd_smart_inject_ctrl_temperature;
 } LIBNDCTL_16;
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index a94f894..5ddc682 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -308,6 +308,7 @@ struct ndctl_dimm_ops {
 	int (*smart_threshold_set_spares)(struct ndctl_cmd *, unsigned int);
 	struct ndctl_cmd *(*new_smart_inject)(struct ndctl_dimm *);
 	int (*smart_inject_media_temperature)(struct ndctl_cmd *, bool, unsigned int);
+	int (*smart_inject_ctrl_temperature)(struct ndctl_cmd *, bool, unsigned int);
 	int (*smart_inject_spares)(struct ndctl_cmd *, bool, unsigned int);
 	int (*smart_inject_fatal)(struct ndctl_cmd *, bool);
 	int (*smart_inject_unsafe_shutdown)(struct ndctl_cmd *, bool);
diff --git a/ndctl/lib/smart.c b/ndctl/lib/smart.c
index 7ba46d1..0e180cf 100644
--- a/ndctl/lib/smart.c
+++ b/ndctl/lib/smart.c
@@ -146,6 +146,7 @@ NDCTL_EXPORT int ndctl_cmd_##op(struct ndctl_cmd *cmd, bool enable, unsigned int
 }
 
 smart_cmd_inject_val(smart_inject_media_temperature)
+smart_cmd_inject_val(smart_inject_ctrl_temperature)
 smart_cmd_inject_val(smart_inject_spares)
 
 #define smart_cmd_inject(op) \
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 6a6bb0d..e60d80b 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -285,6 +285,8 @@ int ndctl_cmd_smart_threshold_set_spares(struct ndctl_cmd *cmd,
 struct ndctl_cmd *ndctl_dimm_cmd_new_smart_inject(struct ndctl_dimm *dimm);
 int ndctl_cmd_smart_inject_media_temperature(struct ndctl_cmd *cmd, bool enable,
 		unsigned int mtemp);
+int ndctl_cmd_smart_inject_ctrl_temperature(struct ndctl_cmd *cmd, bool enable,
+		unsigned int ctemp);
 int ndctl_cmd_smart_inject_spares(struct ndctl_cmd *cmd, bool enable,
 		unsigned int spares);
 int ndctl_cmd_smart_inject_fatal(struct ndctl_cmd *cmd, bool enable);
-- 
2.18.0


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

                 reply	other threads:[~2018-07-31 12:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180731121842.27213-1-qi.fuli@jp.fujitsu.com \
    --to=qi.fuli@jp.fujitsu.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).