From patchwork Mon Oct 10 22:41:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 13003301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D769C433F5 for ; Mon, 10 Oct 2022 22:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbiJJWnG (ORCPT ); Mon, 10 Oct 2022 18:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiJJWnF (ORCPT ); Mon, 10 Oct 2022 18:43:05 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4C4B66A4F; Mon, 10 Oct 2022 15:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665441784; x=1696977784; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eQESRMBh/lxlX7p179P4x0M4lLpqCwoTA2mtPcsMflg=; b=l1Ycjd45lydV+gqUgjrfPVnx8NdaBYMWlDlNEy/WsTeuJEvwT/YaY1gp xp6pPrs0lSW8rxoFVU3Z5hROkwZh8chWBHQgv4jBB+h/Q6ZKypuVgb+7R TgS5mjbAbRmp3vj4a792Om1thOZClJVuAj+T1QSAmCorn7bicFEa4BC8q DlblEgb6XdIsjR8jWUw61i6ASZhoJHxtbLwc1ln7TpQIIIU10oABnD1sm 71xdv8aLld6tYKjoJgfa/kgMLP4S8rVkhyOgOw0dWrAhzEv4YzXwZyGJq ZSTWUjw74uRItl8bKH83tBpTuaiIyhQ8V+tZpbSK0zIzt/tSDYdO6ERd5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="287615375" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="287615375" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 15:43:04 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="621191330" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="621191330" Received: from iweiny-desk3.amr.corp.intel.com (HELO localhost) ([10.252.141.94]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 15:43:03 -0700 From: ira.weiny@intel.com To: Dan Williams Cc: Ira Weiny , Alison Schofield , Vishal Verma , Ben Widawsky , Steven Rostedt , Jonathan Cameron , Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Subject: [RFC V2 PATCH 01/11] cxl/mbox: Add debug of hardware error code Date: Mon, 10 Oct 2022 15:41:21 -0700 Message-Id: <20221010224131.1866246-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221010224131.1866246-1-ira.weiny@intel.com> References: <20221010224131.1866246-1-ira.weiny@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org From: Ira Weiny If a mailbox command fails the driver always reports ENXIO. But this may not be enough information to understand why the hardware, or in my case Qemu, was failing. Add a debug print of the error code returned from the hardware. Signed-off-by: Ira Weiny Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso --- drivers/cxl/core/mbox.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index 16176b9278b4..6c4d024ad0e8 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -181,8 +181,11 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in, if (rc) return rc; - if (mbox_cmd.return_code != CXL_MBOX_CMD_RC_SUCCESS) + if (mbox_cmd.return_code != CXL_MBOX_CMD_RC_SUCCESS) { + dev_dbg(cxlds->dev, "MB error : %s\n", + cxl_mbox_cmd_rc2str(&mbox_cmd)); return cxl_mbox_cmd_rc2errno(&mbox_cmd); + } /* * Variable sized commands can't be validated and so it's up to the