lkml.org 
[lkml]   [2022]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC V2 PATCH 01/11] cxl/mbox: Add debug of hardware error code
Date
From: Ira Weiny <ira.weiny@intel.com>

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 <ira.weiny@intel.com>
---
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
\
 
 \ /
  Last update: 2022-10-11 00:43    [W:0.296 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site