mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h
@ 2026-10-15  5:50 Gaobin Huang
  2026-10-15  8:16 ` Richard Cheng
  0 siblings, 1 reply; 5+ messages in thread
From: Gaobin Huang @ 2026-10-15  5:50 UTC (permalink / raw)
  To: linux-cxl
  Cc: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Dan Williams, Ira Weiny, Li Ming, Richard Cheng,
	linux-kernel

CMD_CMD_RC_TABLE ends at 001Eh (Invalid Extent List), but the command
return code table in CXL r4.0 Table 8-208 also defines:

  001Fh  Transfer Out of Order: The input parameters data transfer was
         aborted because it occurred out of order.
  0020h  Request Abort Not Supported by Background Operation: The ongoing
         background operation does not support the Request Abort command.

A device that reports either code is described as an unknown return code.
Add both entries, mapped to -ENXIO.

Signed-off-by: Gaobin Huang <huanggaobin23@semi.ac.cn>
---
 drivers/cxl/cxlmem.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
index c401e3a1a..43f29564c 100644
--- a/drivers/cxl/cxlmem.h
+++ b/drivers/cxl/cxlmem.h
@@ -190,6 +190,8 @@ static inline struct cxl_ep *cxl_ep_load(struct cxl_port *port,
 	C(FEATURETRANSFEROOO, -ENXIO, "feature transfer out of order"),		\
 	C(RESOURCEEXHAUSTED, -ENXIO, "resources are exhausted"),		\
 	C(EXTLIST, -ENXIO, "invalid Extent List"),				\
+	C(TRANSFEROOO, -ENXIO, "transfer out of order"),			\
+	C(REQABORTNOTSUP, -ENXIO, "request abort not supported"),		\
 
 #undef C
 #define C(a, b, c) CXL_MBOX_CMD_RC_##a

base-commit: 999811aca000b0d3d1c838c60dc9db7c72eb0c73
-- 
2.34.1


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

* Re: [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h
  2026-10-15  5:50 [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h Gaobin Huang
@ 2026-10-15  8:16 ` Richard Cheng
  2026-10-15  8:42   ` 黄高彬
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Cheng @ 2026-10-15  8:16 UTC (permalink / raw)
  To: Gaobin Huang
  Cc: linux-cxl, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
	Alison Schofield, Vishal Verma, Dan Williams, Ira Weiny, Li Ming,
	linux-kernel

On Thu, Oct 15, 2026 at 01:50:48PM +0800, Gaobin Huang wrote:
> CMD_CMD_RC_TABLE ends at 001Eh (Invalid Extent List), but the command
> return code table in CXL r4.0 Table 8-208 also defines:
> 
>   001Fh  Transfer Out of Order: The input parameters data transfer was
>          aborted because it occurred out of order.
>   0020h  Request Abort Not Supported by Background Operation: The ongoing
>          background operation does not support the Request Abort command.
> 
> A device that reports either code is described as an unknown return code.
> Add both entries, mapped to -ENXIO.
> 
> Signed-off-by: Gaobin Huang <huanggaobin23@semi.ac.cn>
> ---
>  drivers/cxl/cxlmem.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
> index c401e3a1a..43f29564c 100644
> --- a/drivers/cxl/cxlmem.h
> +++ b/drivers/cxl/cxlmem.h
> @@ -190,6 +190,8 @@ static inline struct cxl_ep *cxl_ep_load(struct cxl_port *port,
>  	C(FEATURETRANSFEROOO, -ENXIO, "feature transfer out of order"),		\
>  	C(RESOURCEEXHAUSTED, -ENXIO, "resources are exhausted"),		\
>  	C(EXTLIST, -ENXIO, "invalid Extent List"),				\
> +	C(TRANSFEROOO, -ENXIO, "transfer out of order"),			\
> +	C(REQABORTNOTSUP, -ENXIO, "request abort not supported"),		\

Hi Gaobin,

Do we have users for them ? or potential users ?

Best regards,
Richard Cheng.

>  
>  #undef C
>  #define C(a, b, c) CXL_MBOX_CMD_RC_##a
> 
> base-commit: 999811aca000b0d3d1c838c60dc9db7c72eb0c73
> -- 
> 2.34.1
> 

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

* Re: Re: [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h
  2026-10-15  8:16 ` Richard Cheng
@ 2026-10-15  8:42   ` 黄高彬
  2026-10-15 15:17     ` Dave Jiang
  0 siblings, 1 reply; 5+ messages in thread
From: 黄高彬 @ 2026-10-15  8:42 UTC (permalink / raw)
  To: Richard Cheng
  Cc: linux-cxl, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
	Alison Schofield, Vishal Verma, Dan Williams, Ira Weiny, Li Ming,
	linux-kernel

Hi Richard,

> Do we have users for them ? or potential users ?

I checked the related code, and the honest answer is no for both today.

001Fh is the code Perform Maintenance (opcode 0600h) returns when the input
parameters are transferred in parts and the parts arrive out of order --
Action = Initiate Transfer, Continue Transfer, End Transfer (CXL r4.0,
8.2.10.7).  Linux does issue Perform Maintenance: PPR and the sparing
operations in edac.c both go through cxl_perform_maintenance().  That helper
always transfers the parameters in a single command though -- it returns
-ENOMEM when they do not fit in the mailbox payload instead of chunking --
so the ordering condition cannot arise from the driver.  The multi-chunk
flow in the specification is described for the Built-In Self-Test test
parameters, and there is no BIST support in the driver.

0020h is only the return code of Request Abort Background Operation (opcode
0005h).  Linux does not issue that command either.

So neither code has a producer in the driver today.  Both are defined in the
command return code table (CXL r4.0 Table 8-208) that CMD_CMD_RC_TABLE
transcribes, and carrying them costs two lines and no behavior change: a
device that reports either already comes back as -ENXIO through the
unknown-code path, so what the entries buy is a name instead of "unknown
return code".

If the point is that a definition should arrive with the code that can
produce it, that is a fair position too.  I can withdraw this patch and
resend it together with chunked maintenance transfer support, or with abort
support, whichever is implemented first. 

Thanks,
Gaobin

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

* Re: [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h
  2026-10-15  8:42   ` 黄高彬
@ 2026-10-15 15:17     ` Dave Jiang
  2026-10-15 17:39       ` Alison Schofield
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Jiang @ 2026-10-15 15:17 UTC (permalink / raw)
  To: 黄高彬, Richard Cheng
  Cc: linux-cxl, Davidlohr Bueso, Jonathan Cameron, Alison Schofield,
	Vishal Verma, Dan Williams, Ira Weiny, Li Ming, linux-kernel



On 10/15/26 1:42 AM, 黄高彬 wrote:
> Hi Richard,
> 
>> Do we have users for them ? or potential users ?
> 
> I checked the related code, and the honest answer is no for both today.
> 
> 001Fh is the code Perform Maintenance (opcode 0600h) returns when the input
> parameters are transferred in parts and the parts arrive out of order --
> Action = Initiate Transfer, Continue Transfer, End Transfer (CXL r4.0,
> 8.2.10.7).  Linux does issue Perform Maintenance: PPR and the sparing
> operations in edac.c both go through cxl_perform_maintenance().  That helper
> always transfers the parameters in a single command though -- it returns
> -ENOMEM when they do not fit in the mailbox payload instead of chunking --
> so the ordering condition cannot arise from the driver.  The multi-chunk
> flow in the specification is described for the Built-In Self-Test test
> parameters, and there is no BIST support in the driver.
> 
> 0020h is only the return code of Request Abort Background Operation (opcode
> 0005h).  Linux does not issue that command either.
> 
> So neither code has a producer in the driver today.  Both are defined in the
> command return code table (CXL r4.0 Table 8-208) that CMD_CMD_RC_TABLE
> transcribes, and carrying them costs two lines and no behavior change: a
> device that reports either already comes back as -ENXIO through the
> unknown-code path, so what the entries buy is a name instead of "unknown
> return code".
> 
> If the point is that a definition should arrive with the code that can
> produce it, that is a fair position too.  I can withdraw this patch and
> resend it together with chunked maintenance transfer support, or with abort
> support, whichever is implemented first. 

Yes lets do that.
> 
> Thanks,
> Gaobin


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

* Re: [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h
  2026-10-15 15:17     ` Dave Jiang
@ 2026-10-15 17:39       ` Alison Schofield
  0 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2026-10-15 17:39 UTC (permalink / raw)
  To: Dave Jiang
  Cc: 黄高彬,
	Richard Cheng, linux-cxl, Davidlohr Bueso, Jonathan Cameron,
	Vishal Verma, Dan Williams, Ira Weiny, Li Ming, linux-kernel

On Thu, Oct 15, 2026 at 08:17:19AM -0700, Dave Jiang wrote:
> 
> 
> On 10/15/26 1:42 AM, 黄高彬 wrote:
> > Hi Richard,
> > 
> >> Do we have users for them ? or potential users ?
> > 
> > I checked the related code, and the honest answer is no for both today.


Hi Gaobin,

I apologize for the bad suggestion here.

So, devices will return codes Linux doesn't recognize and your other
patch [1]  protects against that. As others responded here, we'll
add the new codes when we need them, not before.

https://lore.kernel.org/linux-cxl/3ed8f5db3f21c937d8783f31ee6faca3703ba72a.1791949910.git.alison.schofield@intel.com/

-- Alison

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

end of thread, other threads:[~2026-10-15 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-15  5:50 [PATCH] cxl/mbox: Add the CXL 4.0 command return codes 001Fh and 0020h Gaobin Huang
2026-10-15  8:16 ` Richard Cheng
2026-10-15  8:42   ` 黄高彬
2026-10-15 15:17     ` Dave Jiang
2026-10-15 17:39       ` Alison Schofield

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®