From patchwork Mon Jan 14 18:11:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 10763267 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 2AB8991E for ; Mon, 14 Jan 2019 18:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19A6E29B07 for ; Mon, 14 Jan 2019 18:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B95B29B0A; Mon, 14 Jan 2019 18:11:33 +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 A9E0929AFC for ; Mon, 14 Jan 2019 18:11:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 73625211963D3; Mon, 14 Jan 2019 10:11:32 -0800 (PST) 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=134.134.136.31; helo=mga06.intel.com; envelope-from=vishal.l.verma@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 0DE2F21A143EF for ; Mon, 14 Jan 2019 10:11:31 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 10:11:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,478,1539673200"; d="scan'208";a="310333757" Received: from vverma7-desk1.lm.intel.com ([10.232.112.170]) by fmsmga006.fm.intel.com with ESMTP; 14 Jan 2019 10:11:30 -0800 From: Vishal Verma To: Subject: [ndctl PATCH v3 0/4] Add missing firmware_status checks Date: Mon, 14 Jan 2019 11:11:11 -0700 Message-Id: <20190114181115.11983-1-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.17.2 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 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 Changes in v3: - Patch 2: Also fix open coded get_firmware_status (Dan) - Patch 4: Change rc to an int as it is only used for the return status of cmd_submit. - Patch 4: Fix another open coded get_firmware_status in test/ack-shutdown-count-set.c Changes in v2: - For the new helper, return original positive rc when we can (Dan) - Convert previously missed locations to the new submission helper (patch 2) - Add a new patch (4/4) to fix up all callers of ndctl_cmd_submit to the correct return convention. There were several places in ndctl where we neglected to check the firmware_status from a command submission. Add an ndctl_dimm_op target to perform error translation for a DSM family, and provide a new helper - ndctl_cmd_submit_xlat - that will submit the command and call an error translation routine if one has been registered. Switch the call sites in ndctl/inject-smart.c and ndctl/monitor.c over to the new command submission helper. Finally, clean up all remaining callers of ndctl_cmd_submit to use the correct return convention, i.e. only treat negative returns as an error, and accept positive return codes as OK. Vishal Verma (4): libndctl, intel: Add infrastructure for firmware_status translation ndctl, inject-smart: switch to ndctl_cmd_submit_xlat ndctl, monitor: switch to ndctl_cmd_submit_xlat ndctl: clean up usage of ndctl_cmd_submit ndctl/inject-smart.c | 16 ++++++------ ndctl/lib/dimm.c | 6 ++--- ndctl/lib/inject.c | 8 +++--- ndctl/lib/intel.c | 49 +++++++++++++++++++++++++++++++++++ ndctl/lib/intel.h | 1 + ndctl/lib/libndctl.c | 28 ++++++++++++++++++++ ndctl/lib/libndctl.sym | 6 +++++ ndctl/lib/nfit.c | 2 +- ndctl/lib/private.h | 1 + ndctl/libndctl.h | 3 +++ ndctl/monitor.c | 6 ++--- ndctl/util/json-firmware.c | 2 +- ndctl/util/json-smart.c | 8 +++--- test/ack-shutdown-count-set.c | 8 ++---- test/daxdev-errors.c | 8 +++--- test/libndctl.c | 32 +++++++++++------------ test/smart-notify.c | 8 +++--- 17 files changed, 138 insertions(+), 54 deletions(-)