Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp647366ybt; Mon, 6 Jul 2020 19:16:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDFwSKcv1hSvChS2DAry5kdksTC8EzLWWG6hwPMH014sYQS/8nnDsNFmDOT6Xitv0R4A5a X-Received: by 2002:aa7:d341:: with SMTP id m1mr46089411edr.50.1594088178511; Mon, 06 Jul 2020 19:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594088178; cv=none; d=google.com; s=arc-20160816; b=uYC7+tL/jFdczRwxdavkIH5mhQSnG477OjwrF+LwGEGwYzuWvZanK3udXzMsxvZNRS US56p1KqQoCeNLE8Tm1Xn7z61wTpZODeaJ3n9w0EGfkH+CSiFaRoUpXtJcBErVwGJToA YBEq8nFFDoexxbKlg2PDcoHncFDqKuM+8ZM+yA8XHlj5VHhDIIKLrHSk839dgu/sRizN YixyjW5SmvXR9rABS46lLiljy93bjDyZi1CZx3NRoY/jhCdtHZ3KY0XMpiBwNlGH3V/P VD68TuimavN67WebT534TT3tMQfnyN7ZSgECN/1P6yiuynY+OrNhOczLJL0myhGOwftd dPag== 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=hG355iEnK/QpZFG6KM2JFxqg6PYjABBsJC+9JP2sQ58=; b=a2y4KIyrBv+m6MvHLc6yAa+UxRe/HOobXYHYrm8pDYcsP4317OlQoVgDSMySR2Zc3m E+joR1q/Qz5zthwnDctp27aaDFo9vDGYETHEOklOeRs9xxtSbbuL8Dn9NMqknxLFFBV9 CFaKbuytDQSlIruNhNBDiQpyg1vP76yXo5y0D20ikWHkD7Nfcx3SNFXpx7s10w8pEufC 8CHJVxt/+4fhBBPwbaKA0Giw622yyNDF0Bx24fk7y5A2QHRIwtAV4klJRTZVtaC/NsRW xPOBioyMW8eKiaS63yzz5zivjzgqIvDi7yu3U7mftK6w1+HlZc+FI8teJsIXwPYh1drG uDiA== 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 dp1si19286941ejc.505.2020.07.06.19.15.54; Mon, 06 Jul 2020 19:16:18 -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 S1727928AbgGGCPR (ORCPT + 99 others); Mon, 6 Jul 2020 22:15:17 -0400 Received: from mga03.intel.com ([134.134.136.65]:43231 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbgGGCPQ (ORCPT ); Mon, 6 Jul 2020 22:15:16 -0400 IronPort-SDR: THL3/P6f4E9zYLMxmi7VTuRpKsuMOS8CVV7+i01Lzg923ZcLLpiy48T8QY516Bb2iy+lLoLV4q SONq/P6aXs4A== X-IronPort-AV: E=McAfee;i="6000,8403,9674"; a="147538430" X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="147538430" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 19:15:16 -0700 IronPort-SDR: KWr+41UF5dK/EYqIBkmvjCHmMhXGfr/dDGAD67iDdqulXAw0gLqjYLgg6fGNi1+pkyIcBoVPVz Tnjb5sFUxFdg== X-IronPort-AV: E=Sophos;i="5.75,321,1589266800"; d="scan'208";a="482894773" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2020 19:15:15 -0700 Subject: [PATCH v2 05/12] tools/testing/nvdimm: Add command debug messages From: Dan Williams To: linux-nvdimm@lists.01.org Cc: vishal.l.verma@intel.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 06 Jul 2020 18:59:00 -0700 Message-ID: <159408714018.2385045.16027230217932492420.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <159408711335.2385045.2567600405906448375.stgit@dwillia2-desk3.amr.corp.intel.com> References: <159408711335.2385045.2567600405906448375.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. 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);