From patchwork Tue Jul 31 12:18:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: QI Fuli X-Patchwork-Id: 10550709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2520F157D for ; Tue, 31 Jul 2018 12:18:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 105B42ABAD for ; Tue, 31 Jul 2018 12:18:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 037892ABBF; Tue, 31 Jul 2018 12:18:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 81FE82ABAD for ; Tue, 31 Jul 2018 12:18:58 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 20B3E210C6434; Tue, 31 Jul 2018 05:18:58 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=211.128.242.43; helo=mgwym04.jp.fujitsu.com; envelope-from=qi.fuli@jp.fujitsu.com; receiver=linux-nvdimm@lists.01.org Received: from mgwym04.jp.fujitsu.com (mgwym04.jp.fujitsu.com [211.128.242.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9132D21CB74A4 for ; Tue, 31 Jul 2018 05:18:56 -0700 (PDT) Received: from yt-mxq.gw.nic.fujitsu.com (unknown [192.168.229.66]) by mgwym04.jp.fujitsu.com with smtp id 5a54_095c_8800fdf7_9dfd_4106_a726_c56b71e2c364; Tue, 31 Jul 2018 21:18:51 +0900 Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by yt-mxq.gw.nic.fujitsu.com (Postfix) with ESMTP id 89A99AC00F3 for ; Tue, 31 Jul 2018 21:18:50 +0900 (JST) Received: from localhost.localdomain (unknown [10.124.196.110]) by m3050.s.css.fujitsu.com (Postfix) with ESMTP id 783981B7; Tue, 31 Jul 2018 21:18:50 +0900 (JST) From: QI Fuli 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 Message-Id: <20180731121842.27213-1-qi.fuli@jp.fujitsu.com> X-Mailer: git-send-email 2.18.0 X-TM-AS-MML: disable X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);