Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1428420rwi; Mon, 10 Oct 2022 16:38:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jBkxensoZHONVQgNh8AQf0MV4na+jyjJQy98EQMyeshIxOuHUi90l5cuvwUBeR+7qfsLo X-Received: by 2002:a05:6a00:21c6:b0:563:9169:3a4c with SMTP id t6-20020a056a0021c600b0056391693a4cmr3887414pfj.56.1665445129457; Mon, 10 Oct 2022 16:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665445129; cv=none; d=google.com; s=arc-20160816; b=ThoExkSwGC/aTABMPD29YgqKjxMoHE0jBekdyQWCUlo24tKPqfe5Z7DgkNLzGd5XPk Ohiv8A7w/KMFGXa4DnziwFVGFopTO6QXJupMagp11gm72BmxDn/N6/xV440u7u+UfDCu mrFaW0mfCxIv19muh6t7WD07Fl2gKA41yWOwPk9Q+xpxgQBfJEXtpyP5jpirLwQBc7AI 8Q0vH8de8ktYyCxbNBskc4qZHl8VNssrJAoOqyG8EKfm4NLr/0YZyro6gFSqIYFhjLYj Py5cX8BIxpExzZii+77H+u598NpW3tZgwpeIC3GoJLAevRc2GiimMe6PCU8wVrq76/PQ aveg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M/PmZj+HS9hMqnyJfappAID19b21uMcBU+C1XZFN59A=; b=ElJtdI444Oi6zT9q4iPudCPi1xlCDojfYBDHqT6421hne4xA+DvB6XD8jCUjdRw2o9 GWvLe1vKyMBbknJW1Ur1R6BQ8giRC8GtN4G9jiKT0tnKRL0IwzgDBxzink59HGj5T+45 7+SbQJUjDWgwoIBpD6gxHKHhM4GZe+9sxvoTFsPNG4qirDvjGZhbqmVIm/oBxD34SmKK BR40WATqMTKcFaiix5GNvWoBp8ciHfVk5cAukXPjehDsrKpTqteP0JMustm9Y8nNo3eZ Ju4u04kLrlL2GDWTnpi4oYezkN0/clMzB4jx+iXhSFGnMDmBqy24uBUnjexg8PMGs8ru gbtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l1Ycjd45; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902f70500b00174ab1a7deasi13470147plo.316.2022.10.10.16.38.38; Mon, 10 Oct 2022 16:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l1Ycjd45; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbiJJWnJ (ORCPT + 99 others); Mon, 10 Oct 2022 18:43:09 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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 -- 2.37.2