public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"Vishal Verma" <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	"Dan Williams" <dan.j.williams@intel.com>
Cc: <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH] cxl/region: Test CXL_DECODER_F_NORMALIZED_ADDRESSING as a bitmask
Date: Thu, 5 Feb 2026 17:46:47 -0800	[thread overview]
Message-ID: <aYVIB1PvG6Htuiyd@aschofie-mobl2.lan> (raw)
In-Reply-To: <20260206013135.1012375-1-alison.schofield@intel.com>

On Thu, Feb 05, 2026 at 05:31:33PM -0800, Alison Schofield wrote:
> CXL_DECODER_F_NORMALIZED_ADDRESSING is a bitmask, not a bit index.
> Using test_bit() to check it caused undefined behavior making the
> flag sometimes appear set. This prevented creation of CXL region
> debugfs attributes that support poison actions.
> 
> Replace test_bit() with a bitmask check.
> 
> Found with cxl-test.

I was focused on getting this test case to work so it wasn't
until I hit send on the patch that I see there are a couple of
other places to stop using test_bit().
I'll respin and clean these up too:

hdm.c:		if (test_bit(CXL_DECODER_F_LOCK, &cxld->flags))
region.c:	if (test_bit(CXL_DECODER_F_LOCK, &cxld->flags)) {

> 
> Fixes: 208f432406b7 ("cxl: Disable HPA/SPA translation handlers for Normalized Addressing")
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> ---
> 
> DaveJ: The base commit tag is linux-next today. I figure it's closest to what
> we'll see w 7.0-rc1. 
> 
> 
>  drivers/cxl/core/region.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 08fa3deef70a..00a9b57cdd80 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1105,7 +1105,7 @@ static void cxl_region_setup_flags(struct cxl_region *cxlr,
>  		clear_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags);
>  	}
>  
> -	if (test_bit(CXL_DECODER_F_NORMALIZED_ADDRESSING, &cxld->flags))
> +	if (cxld->flags & CXL_DECODER_F_NORMALIZED_ADDRESSING)
>  		set_bit(CXL_REGION_F_NORMALIZED_ADDRESSING, &cxlr->flags);
>  }
>  
> 
> base-commit: 9845cf73f7db6094c0d8419d6adb848028f4a921
> -- 
> 2.37.3
> 

      reply	other threads:[~2026-02-06  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06  1:31 [PATCH] cxl/region: Test CXL_DECODER_F_NORMALIZED_ADDRESSING as a bitmask Alison Schofield
2026-02-06  1:46 ` Alison Schofield [this message]

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=aYVIB1PvG6Htuiyd@aschofie-mobl2.lan \
    --to=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --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