public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl/hdm: Add debug message for invalid interleave granularity
@ 2024-04-02  6:10 Huang Ying
  2024-04-03 15:43 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Huang Ying @ 2024-04-02  6:10 UTC (permalink / raw)
  To: Dan Williams; +Cc: linux-cxl, linux-kernel, Huang Ying

There's no debug message for invalid interleave granularity.  This
makes it hard to debug related bugs.  So, this is added in this patch.

Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
---
 drivers/cxl/core/hdm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 7d97790b893d..973a27543ed5 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -888,8 +888,12 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
 	}
 	rc = eig_to_granularity(FIELD_GET(CXL_HDM_DECODER0_CTRL_IG_MASK, ctrl),
 				 &cxld->interleave_granularity);
-	if (rc)
+	if (rc) {
+		dev_warn(&port->dev,
+			 "decoder%d.%d: Invalid interleave granularity (ctrl: %#x)\n",
+			 port->id, cxld->id, ctrl);
 		return rc;
+	}
 
 	dev_dbg(&port->dev, "decoder%d.%d: range: %#llx-%#llx iw: %d ig: %d\n",
 		port->id, cxld->id, cxld->hpa_range.start, cxld->hpa_range.end,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-03 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02  6:10 [PATCH] cxl/hdm: Add debug message for invalid interleave granularity Huang Ying
2024-04-03 15:43 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox