diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2022-04-03 19:12:15 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2022-04-12 16:07:02 -0700 |
commit | 92fcc1abab095dceb2337444f79875c8a85063df (patch) | |
tree | a96215ace95d5a349e9edac1b16f7e7083a70ecc /drivers/cxl/core/mbox.c | |
parent | cbe83a2052682c6f57d45f76fe7fea4bf254acd9 (diff) |
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/core/mbox.c')
-rw-r--r-- | drivers/cxl/core/mbox.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index 187590c9844c..5adc0ddb1737 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -181,7 +181,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in, return rc; /* TODO: Map return code to proper kernel style errno */ - if (mbox_cmd.return_code != CXL_MBOX_SUCCESS) + if (mbox_cmd.return_code != CXL_MBOX_CMD_RC_SUCCESS) return -ENXIO; /* |