Linux CXL
 help / color / mirror / Atom feed
From: Richard Cheng <icheng@nvidia.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	 Jonathan Cameron <jic23@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	 Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <iweiny@kernel.org>, Li Ming <ming.li@zohomail.com>,
	 linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/3] tools/testing/cxl: Preserve DPA skip across mock decoder reset
Date: Tue, 29 Sep 2026 18:11:01 +0800	[thread overview]
Message-ID: <aruNqCJcxakvq3TM@MWDK4CY14F> (raw)
In-Reply-To: <51807396d62a65dc457706b454102cedb6446bbb.1790641236.git.alison.schofield@intel.com>

On Mon, Sep 28, 2026 at 05:56:16PM +0800, Alison Schofield wrote:
> Mock decoder reset clears the DPA skip before releasing the decoder's
> resources. This leaks skipped capacity and can cause a later DPA
> allocation to fail with ENOSPC.
> 
> Preserve the skip until the DPA resource is released.
> 
> Assisted-by: LLM
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> ---
>  tools/testing/cxl/test/cxl.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
> index 62bd92b3be45..aa140307e0c3 100644
> --- a/tools/testing/cxl/test/cxl.c
> +++ b/tools/testing/cxl/test/cxl.c
> @@ -913,15 +913,13 @@ static void __cxld_registry_save(struct cxl_test_decoder *td,
>  
>  		cxld_copy(&td->cxled.cxld, cxld);
>  		td->cxled.state = cxled->state;
> -		td->cxled.skip = cxled->skip;
>  
> -		if (!(cxld->flags & CXL_DECODER_F_ENABLE)) {
> -			td->dpa_range.start = 0;
> -			td->dpa_range.end = -1;
> -		} else if (cxled->dpa_res) {
> +		if ((cxld->flags & CXL_DECODER_F_ENABLE) && cxled->dpa_res) {
> +			td->cxled.skip = cxled->skip;
>  			td->dpa_range.start = cxled->dpa_res->start;
>  			td->dpa_range.end = cxled->dpa_res->end;
>  		} else {
> +			td->cxled.skip = 0;
>  			td->dpa_range.start = 0;
>  			td->dpa_range.end = -1;
>  		}
> @@ -1001,7 +999,6 @@ static void mock_decoder_reset(struct cxl_decoder *cxld)
>  			to_cxl_endpoint_decoder(&cxld->dev);
>  
>  		cxled->state = CXL_DECODER_STATE_MANUAL;
> -		cxled->skip = 0;
>  	}
>  	if (decoder_reset_preserve_registry)
>  		dev_dbg(port->uport_dev, "decoder%d: skip registry update\n",
> -- 
> 2.37.3
>

LGTM.

Reviewed-by: Richard Cheng <icheng@nvidia.com>

Best regards,
Richard Cheng. 

  reply	other threads:[~2026-09-29 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  0:56 [PATCH 0/3] cxl/test: mock fixups and new topology support Alison Schofield
2026-09-29  0:56 ` [PATCH 1/3] tools/testing/cxl: Preserve DPA skip across mock decoder reset Alison Schofield
2026-09-29 10:11   ` Richard Cheng [this message]
2026-09-29  0:56 ` [PATCH 2/3] tools/testing/cxl: Skip the auto region when no volatile window is active Alison Schofield
2026-09-30  7:33   ` Richard Cheng
2026-10-09 21:45     ` Alison Schofield
2026-09-29  0:56 ` [PATCH 3/3] tools/testing/cxl: Add CFMWS windows for region selection tests Alison Schofield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aruNqCJcxakvq3TM@MWDK4CY14F \
    --to=icheng@nvidia.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox