From patchwork Mon Jun 25 08:42:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: QI Fuli X-Patchwork-Id: 10485303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A48C60230 for ; Mon, 25 Jun 2018 08:43:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41CC628813 for ; Mon, 25 Jun 2018 08:43:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3569D288E8; Mon, 25 Jun 2018 08:43:01 +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 C53F328813 for ; Mon, 25 Jun 2018 08:43:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 48C922095DC98; Mon, 25 Jun 2018 01:43:00 -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 748B6203B99D2 for ; Mon, 25 Jun 2018 01:42:57 -0700 (PDT) Received: from yt-mxoi2.gw.nic.fujitsu.com (unknown [192.168.229.69]) by mgwym04.jp.fujitsu.com with smtp id 1eae_819a_30f41107_765c_4a3e_bea7_654822f9c786; Mon, 25 Jun 2018 17:42:51 +0900 Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by yt-mxoi2.gw.nic.fujitsu.com (Postfix) with ESMTP id 53489AC0166 for ; Mon, 25 Jun 2018 17:42:50 +0900 (JST) Received: from qi-fedora.fujitsu.com (unknown [10.124.196.110]) by m3051.s.css.fujitsu.com (Postfix) with ESMTP id 36468113; Mon, 25 Jun 2018 17:42:50 +0900 (JST) From: QI Fuli To: linux-nvdimm@lists.01.org Subject: [PATCH] ndctl, list: add controller temperature threshold Date: Mon, 25 Jun 2018 17:42:17 +0900 Message-Id: <20180625084217.10608-1-qi.fuli@jp.fujitsu.com> X-Mailer: git-send-email 2.17.1 X-TM-AS-MML: disable X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.26 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 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 --- 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;