summaryrefslogtreecommitdiff
path: root/drivers/cxl/pci.c
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2022-04-04 05:12:15 +0300
committerDan Williams <dan.j.williams@intel.com>2022-04-13 02:07:02 +0300
commit92fcc1abab095dceb2337444f79875c8a85063df (patch)
treea96215ace95d5a349e9edac1b16f7e7083a70ecc /drivers/cxl/pci.c
parentcbe83a2052682c6f57d45f76fe7fea4bf254acd9 (diff)
downloadlinux-92fcc1abab095dceb2337444f79875c8a85063df.tar.xz
cxl/mbox: Improve handling of mbox_cmd hw return codes
Upon a completed command the caller is still expected to check the actual return_code register to ensure it succeed. This adds, per the spec, the potential command return codes. It maps the hardware return code with the kernel's errno style, and by default continues to use -ENXIO (Command completed, but device reported an error). Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed by: Adam Manzanares <a.manzanares@samsung.com> Link: https://lore.kernel.org/r/20220404021216.66841-4-dave@stgolabs.net Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/pci.c')
-rw-r--r--drivers/cxl/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 94a91048e2f6..88fcd6cc38a3 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -177,7 +177,7 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_dev_state *cxlds,
mbox_cmd->return_code =
FIELD_GET(CXLDEV_MBOX_STATUS_RET_CODE_MASK, status_reg);
- if (mbox_cmd->return_code != CXL_MBOX_SUCCESS) {
+ if (mbox_cmd->return_code != CXL_MBOX_CMD_RC_SUCCESS) {
dev_dbg(dev, "Mailbox operation had an error\n");
return 0; /* completed but caller must check return_code */
}