cxl/mbox: Improve handling of mbox_cmd hw return codes
authorDavidlohr Bueso <dave@stgolabs.net>
Mon, 4 Apr 2022 02:12:15 +0000 (19:12 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 12 Apr 2022 23:07:02 +0000 (16:07 -0700)
commit92fcc1abab095dceb2337444f79875c8a85063df
treea96215ace95d5a349e9edac1b16f7e7083a70ecc
parentcbe83a2052682c6f57d45f76fe7fea4bf254acd9
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>
drivers/cxl/core/mbox.c
drivers/cxl/cxlmem.h
drivers/cxl/pci.c