Re: [PATCH] cxl/core: fix test_bit misuse with CXL_DECODER_F_ bitmask flags

From: Gregory Price

Date: Mon Feb 23 2026 - 12:49:16 EST


On Mon, Feb 23, 2026 at 11:33:13AM -0600, Cheatham, Benjamin wrote:
> On 2/20/2026 8:18 PM, Gregory Price wrote:
> > CXL_DECODER_F_LOCK (BIT(4) = 16) and CXL_DECODER_F_NORMALIZED_ADDRESSING
> > (BIT(6) = 64) are bit masks, but three call sites pass them to test_bit()
> > which expects a bit number.
> >
> > Replace test_bit() with direct bitmask tests, consistent with every other
> > use of these flags.
> >
> > Fixes: 2230c4bdc412 ("cxl: Add handling of locked CXL decoder")
> > Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
>
> Alison sent out a patch [1] two weeks ago for this. I suspect you found this bug
> independently, so I figured I should point it out. Otherwise, I would add a Reported-by (or some
> other tag) with her name.
>
> Thanks,
> Ben
>
> [1]: https://lore.kernel.org/linux-cxl/20260206181404.1025991-1-alison.schofield@xxxxxxxxx/

Ah, yeah, missed this, and did find independently when testing unbinds.

Wasn't on cxl/next so I thought it hadn't been found yet.

Cool, thanks!
~Gregory