]> git.ipfire.org Git - thirdparty/linux.git/commit
cxl: Test CXL_DECODER_F_LOCK as a bitmask
authorAlison Schofield <alison.schofield@intel.com>
Mon, 23 Feb 2026 19:13:39 +0000 (11:13 -0800)
committerDave Jiang <dave.jiang@intel.com>
Tue, 24 Feb 2026 15:33:30 +0000 (08:33 -0700)
commit0a70b7cd397e545e926c93715ff6366b67c716f6
treebcdc9a21923c676300f6969ab394f93776db51fa
parent60b5d1f68338aff2c5af0113f04aefa7169c50c2
cxl: Test CXL_DECODER_F_LOCK as a bitmask

The CXL decoder flags are defined as bitmasks, not bit indices.
Using test_bit() to check them interprets the mask value as a bit
index, which is the wrong test.

For CXL_DECODER_F_LOCK the test reads beyond the defined bits, causing
the test to always return false and allowing resets that should have
been blocked.

Replace test_bit() with a bitmask check.

Fixes: 2230c4bdc412 ("cxl: Add handling of locked CXL decoder")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
Tested-by: Gregory Price <gourry@gourry.net>
Link: https://patch.msgid.link/98851c4770e4631753cf9f75b58a3a6daeca2ea2.1771873256.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/hdm.c
drivers/cxl/core/region.c