mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] cxl/mbox: Return success for CXL_MBOX_CMD_RC_BACKGROUND
@ 2026-10-20  9:03 Li Ming
  2026-10-20  9:42 ` Richard Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Li Ming @ 2026-10-20  9:03 UTC (permalink / raw)
  To: dave, jic23, dave.jiang, alison.schofield, vishal.l.verma, djbw,
	iweiny, icheng
  Cc: linux-cxl, linux-kernel

In CXL subsystem, each mbox command hw return code is mapped to a
corresponding errno value. Currently, CXL_MBOX_CMD_RC_BACKGROUND is
mapped to -ENXIO.

However, a BACKGROUND hw return code indicates that the command has been
accepted by the device and continues execution asynchronously. It does
not indicate a command failure.

Return 0 instead of -ENXIO for CXL_MBOX_CMD_RC_BACKGROUND so that
callers do not treat a successfully started background operation as an
error.

Fixes: 92fcc1abab09 ("cxl/mbox: Improve handling of mbox_cmd hw return codes")
Signed-off-by: Li Ming <ming.li@zohomail.com>
---
 drivers/cxl/cxlmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
index c401e3a1af06..cc71d7a84cdc 100644
--- a/drivers/cxl/cxlmem.h
+++ b/drivers/cxl/cxlmem.h
@@ -160,7 +160,7 @@ static inline struct cxl_ep *cxl_ep_load(struct cxl_port *port,
  */
 #define CMD_CMD_RC_TABLE							\
 	C(SUCCESS, 0, NULL),							\
-	C(BACKGROUND, -ENXIO, "background cmd started successfully"),           \
+	C(BACKGROUND, 0, "background cmd started successfully"),		\
 	C(INPUT, -ENXIO, "cmd input was invalid"),				\
 	C(UNSUPPORTED, -ENXIO, "cmd is not supported"),				\
 	C(INTERNAL, -ENXIO, "internal device error"),				\
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] cxl/mbox: Return success for CXL_MBOX_CMD_RC_BACKGROUND
  2026-10-20  9:03 [PATCH 1/1] cxl/mbox: Return success for CXL_MBOX_CMD_RC_BACKGROUND Li Ming
@ 2026-10-20  9:42 ` Richard Cheng
  2026-10-20 12:50   ` Li Ming
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Cheng @ 2026-10-20  9:42 UTC (permalink / raw)
  To: Li Ming
  Cc: dave, jic23, dave.jiang, alison.schofield, vishal.l.verma, djbw,
	iweiny, linux-cxl, linux-kernel

On Tue, Oct 20, 2026 at 05:03:52PM +0800, Li Ming wrote:
> In CXL subsystem, each mbox command hw return code is mapped to a
> corresponding errno value. Currently, CXL_MBOX_CMD_RC_BACKGROUND is
> mapped to -ENXIO.
> 
> However, a BACKGROUND hw return code indicates that the command has been
> accepted by the device and continues execution asynchronously. It does
> not indicate a command failure.
>

Hi Li,

Can we have the spec section written here ?
Btw I wonder how you trigger the error ?

Best regards,
Richard Cheng.
 
> Return 0 instead of -ENXIO for CXL_MBOX_CMD_RC_BACKGROUND so that
> callers do not treat a successfully started background operation as an
> error.
> 
> Fixes: 92fcc1abab09 ("cxl/mbox: Improve handling of mbox_cmd hw return codes")
> Signed-off-by: Li Ming <ming.li@zohomail.com>
> ---
>  drivers/cxl/cxlmem.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
> index c401e3a1af06..cc71d7a84cdc 100644
> --- a/drivers/cxl/cxlmem.h
> +++ b/drivers/cxl/cxlmem.h
> @@ -160,7 +160,7 @@ static inline struct cxl_ep *cxl_ep_load(struct cxl_port *port,
>   */
>  #define CMD_CMD_RC_TABLE							\
>  	C(SUCCESS, 0, NULL),							\
> -	C(BACKGROUND, -ENXIO, "background cmd started successfully"),           \
> +	C(BACKGROUND, 0, "background cmd started successfully"),		\
>  	C(INPUT, -ENXIO, "cmd input was invalid"),				\
>  	C(UNSUPPORTED, -ENXIO, "cmd is not supported"),				\
>  	C(INTERNAL, -ENXIO, "internal device error"),				\
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] cxl/mbox: Return success for CXL_MBOX_CMD_RC_BACKGROUND
  2026-10-20  9:42 ` Richard Cheng
@ 2026-10-20 12:50   ` Li Ming
  0 siblings, 0 replies; 3+ messages in thread
From: Li Ming @ 2026-10-20 12:50 UTC (permalink / raw)
  To: Richard Cheng
  Cc: dave, jic23, dave.jiang, alison.schofield, vishal.l.verma, djbw,
	iweiny, linux-cxl, linux-kernel

On 10/20/2026 5:42 PM, Richard Cheng wrote:
> On Tue, Oct 20, 2026 at 05:03:52PM +0800, Li Ming wrote:
>> In CXL subsystem, each mbox command hw return code is mapped to a
>> corresponding errno value. Currently, CXL_MBOX_CMD_RC_BACKGROUND is
>> mapped to -ENXIO.
>>
>> However, a BACKGROUND hw return code indicates that the command has been
>> accepted by the device and continues execution asynchronously. It does
>> not indicate a command failure.
>>
> Hi Li,
Hi Richard,
>
> Can we have the spec section written here ?
Sure.
> Btw I wonder how you trigger the error ?

We cannot trigger this error, currently, driver does not check/use BACKGROUND's error. it is found by review, please see [1]. 

[1]: https://lore.kernel.org/linux-cxl/cover.1791949910.git.alison.schofield@intel.com/T/#mc7764b9f3f470adf62292000299e8288d2241c3d

Ming

>
> Best regards,
> Richard Cheng.
>  
>> Return 0 instead of -ENXIO for CXL_MBOX_CMD_RC_BACKGROUND so that
>> callers do not treat a successfully started background operation as an
>> error.
>>
>> Fixes: 92fcc1abab09 ("cxl/mbox: Improve handling of mbox_cmd hw return codes")
>> Signed-off-by: Li Ming <ming.li@zohomail.com>
>> ---
>>  drivers/cxl/cxlmem.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
>> index c401e3a1af06..cc71d7a84cdc 100644
>> --- a/drivers/cxl/cxlmem.h
>> +++ b/drivers/cxl/cxlmem.h
>> @@ -160,7 +160,7 @@ static inline struct cxl_ep *cxl_ep_load(struct cxl_port *port,
>>   */
>>  #define CMD_CMD_RC_TABLE							\
>>  	C(SUCCESS, 0, NULL),							\
>> -	C(BACKGROUND, -ENXIO, "background cmd started successfully"),           \
>> +	C(BACKGROUND, 0, "background cmd started successfully"),		\
>>  	C(INPUT, -ENXIO, "cmd input was invalid"),				\
>>  	C(UNSUPPORTED, -ENXIO, "cmd is not supported"),				\
>>  	C(INTERNAL, -ENXIO, "internal device error"),				\
>> -- 
>> 2.43.0
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-20 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20  9:03 [PATCH 1/1] cxl/mbox: Return success for CXL_MBOX_CMD_RC_BACKGROUND Li Ming
2026-10-20  9:42 ` Richard Cheng
2026-10-20 12:50   ` Li Ming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®