[PATCH v4 1/6] cxl/region: Warn on user region position mismatch

Alison Schofield <[email protected]>
Newsgroups org.kernel.vger.linux-cxl
Message-ID <c393fd7884c251d86ce3f5c92ed747dc3eef6d8d.1787255388.git.alison.schofield@intel.com>
User region creation includes a self-test that checks the assigned
endpoint positions against the position calculation used by auto
region creation. A mismatch is reported with dev_dbg().

Promote that to a dev_warn() so bugs in the auto region position
calculation are easier to catch as that calculation is extended to
support more region configurations.

Signed-off-by: Alison Schofield <[email protected]>
---

 drivers/cxl/core/region.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 1e211542b6b6..3b640c9ba5a0 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -2218,10 +2218,10 @@ static int cxl_region_attach(struct cxl_region *cxlr,
 		int test_pos;
 
 		test_pos = cxl_calc_interleave_pos(target, &cxlr->hpa_range);
-		dev_dbg(&target->cxld.dev,
-			"Test cxl_calc_interleave_pos(): %s test_pos:%d target->pos:%d\n",
-			(test_pos == target->pos) ? "success" : "fail",
-			test_pos, target->pos);
+		if (test_pos != target->pos)
+			dev_warn(&target->cxld.dev,
+				 "position mismatch: calculated:%d programmed:%d\n",
+				 test_pos, target->pos);
 	}
 
 	return 0;
-- 
2.37.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.