Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp236072ybh; Mon, 20 Jul 2020 15:25:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcj5zJnjJ7f20gTwxoGhNxLAENOz6CdJ9sR+xx587G35xLmaTIWBd/9hKjRZRfmtYec4GM X-Received: by 2002:a05:6402:1a54:: with SMTP id bf20mr23623001edb.69.1595283908505; Mon, 20 Jul 2020 15:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595283908; cv=none; d=google.com; s=arc-20160816; b=OYOJql1vsgIWVNAb2mtHb8ahIUun7cS3kt8yoixxUGMHajQw+lp2rJvNJvF0BTmZ6V CW6uVwbphVPXP+n+baucB/r3TaM7yFyrJ01xddfqlCuthyiMofu5Q5u8awzXyBnc9pA7 gNeyYVFMDdGaEHVpDdnKMbrSdt/+xRPN3/CTQ0LwqijBYRap6WjPXKALWpSiIE/dgjKO dGrN2kwKX15MxkOqdTyhN/1R1BO+flY6cVPGaj/ak/EG6hRTH4gWOgPhI1oAhzcZmZC6 1VXDxOxi7Y9XGWjcCkSTjm0tHgCV0GH/HpvyQlsy5XROf6ZF421uzsbBt+uaEa4Omkb4 Kn2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:ironport-sdr:ironport-sdr; bh=KnVtKFSTRMfrmg5Gb5gXeXqZ+aqegMcYVMlFqpH6vQs=; b=dIHWlQQIGyIsodZlsfMx7Uj1E/DOeOX7HyyI9EtxEtxCkpqD/ya/6kJbZ7blXoSOk/ CHX/7qUv6X3uXGqKCAgwJkXPTKaELjAcFvpOvbFHqUMDFkswf0g3zZcPxAUO0jxXohTn Ck2qmgcjVxdPPwse6Ic06Z8wuYBxJV1pfMS4lKjGiGoGEXe1x+FY13XSFlSlGUcHk5L2 pWX9UwJZQKYGIs1Fgn30oLDomqRHA2c/4BQfZKW7DepEDf2Dl7Ca25GV/0113Lc/iFBp 0TNNEkA1V1e0UD/GLhHGEKyqV3Z75OjMcyaygRvOgxi5uEeSJjvdrngmJbb+K//lYRDf sk9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha25si10645992ejb.628.2020.07.20.15.24.45; Mon, 20 Jul 2020 15:25:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbgGTWYM (ORCPT + 99 others); Mon, 20 Jul 2020 18:24:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:59870 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727038AbgGTWYJ (ORCPT ); Mon, 20 Jul 2020 18:24:09 -0400 IronPort-SDR: qyzjFmFPEO9x7rv2/DtNbAJ/pVlbsb1KPfBSyrcUdkEyQlq/QlOmx7i4boPWHyf9toJ8/q7Mqm f+qSLZd+/87g== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="150005139" X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="150005139" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 15:24:08 -0700 IronPort-SDR: 5+1EOMlqGub/U7YUiikwXqNdswauDaDcb725GRD+uto2I6P+LJKzC5zK0olR0j2b+Tkgr/A4VC zD1RloECXd+A== X-IronPort-AV: E=Sophos;i="5.75,375,1589266800"; d="scan'208";a="319689868" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 15:24:08 -0700 Subject: [PATCH v3 05/11] tools/testing/nvdimm: Add command debug messages From: Dan Williams To: linux-nvdimm@lists.01.org Cc: Vishal Verma , Dave Jiang , Ira Weiny , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 20 Jul 2020 15:07:51 -0700 Message-ID: <159528287151.993790.14142277551897857027.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <159528284411.993790.11733759435137949717.stgit@dwillia2-desk3.amr.corp.intel.com> References: <159528284411.993790.11733759435137949717.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arrange the for nfit_test_ctl() path to dump command payloads similarly to the acpi_nfit_ctl() path. This is useful for comparing the sequence of command events between an emulated ACPI-NFIT platform and a real one. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams --- tools/testing/nvdimm/test/nfit.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index ddf9b3095bfa..9c6f475befe4 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c @@ -1192,6 +1192,29 @@ static int get_dimm(struct nfit_mem *nfit_mem, unsigned int func) return i; } +static void nfit_ctl_dbg(struct acpi_nfit_desc *acpi_desc, + struct nvdimm *nvdimm, unsigned int cmd, void *buf, + unsigned int len) +{ + struct nfit_test *t = container_of(acpi_desc, typeof(*t), acpi_desc); + unsigned int func = cmd; + unsigned int family = 0; + + if (cmd == ND_CMD_CALL) { + struct nd_cmd_pkg *pkg = buf; + + len = pkg->nd_size_in; + family = pkg->nd_family; + buf = pkg->nd_payload; + func = pkg->nd_command; + } + dev_dbg(&t->pdev.dev, "%s family: %d cmd: %d: func: %d input length: %d\n", + nvdimm ? nvdimm_name(nvdimm) : "bus", family, cmd, func, + len); + print_hex_dump_debug("nvdimm in ", DUMP_PREFIX_OFFSET, 16, 4, + buf, min(len, 256u), true); +} + static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc) @@ -1205,6 +1228,8 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc, cmd_rc = &__cmd_rc; *cmd_rc = 0; + nfit_ctl_dbg(acpi_desc, nvdimm, cmd, buf, buf_len); + if (nvdimm) { struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); unsigned long cmd_mask = nvdimm_cmd_mask(nvdimm);