diff mbox series

cxl: downgrade a warning message to debug level in cxl_probe_component_regs()

Message ID 20241021050443.318712-1-colyli@suse.de
State Accepted
Commit 75c301e57dc1582f62da091e63739d38e0d2e6be
Headers show
Series cxl: downgrade a warning message to debug level in cxl_probe_component_regs() | expand

Commit Message

Coly Li Oct. 21, 2024, 5:04 a.m. UTC
In cxl_probe_component_regs() the error message "Couldn't locate the
CXL.cache and CXL.mem capability array header." is not a critical error
message indeed. Downgrade the message from error level to debug level
by using dev_dbg() to print the message, and the end users won't worry
about the message anymore.

Reported-by: Kelvin Shieh <kshieh@lenovo.com>
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: Alison Schofield <alison.schofield@intel.com>
---
 drivers/cxl/core/regs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kelvin Shieh Oct. 21, 2024, 5:20 a.m. UTC | #1
Thanks Coly and Dan for the efforts!

Best regards,
Kelvin

-----Original Message-----
From: Coly Li <colyli@suse.de> 
Sent: Monday, October 21, 2024 1:05 PM
To: dan.j.williams@intel.com
Cc: linux-cxl@vger.kernel.org; Coly Li <colyli@suse.de>; Kelvin Shieh <kshieh@lenovo.com>; Jonathan Cameron <Jonathan.Cameron@Huawei.com>; Alison Schofield <alison.schofield@intel.com>
Subject: [External] [PATCH] cxl: downgrade a warning message to debug level in cxl_probe_component_regs()

In cxl_probe_component_regs() the error message "Couldn't locate the CXL.cache and CXL.mem capability array header." is not a critical error message indeed. Downgrade the message from error level to debug level by using dev_dbg() to print the message, and the end users won't worry about the message anymore.

Reported-by: Kelvin Shieh <kshieh@lenovo.com>
Signed-off-by: Coly Li <colyli@suse.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: Alison Schofield <alison.schofield@intel.com>
---
 drivers/cxl/core/regs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c index e1082e749c69..026690137bc3 100644
--- a/drivers/cxl/core/regs.c
+++ b/drivers/cxl/core/regs.c
@@ -52,7 +52,7 @@ void cxl_probe_component_regs(struct device *dev, void __iomem *base,
 	cap_array = readl(base + CXL_CM_CAP_HDR_OFFSET);
 
 	if (FIELD_GET(CXL_CM_CAP_HDR_ID_MASK, cap_array) != CM_CAP_HDR_CAP_ID) {
-		dev_err(dev,
+		dev_dbg(dev,
 			"Couldn't locate the CXL.cache and CXL.mem capability array header.\n");
 		return;
 	}
--
2.46.0
Dan Williams Oct. 25, 2024, 9:50 p.m. UTC | #2
[ add Dave and Ira ]

Coly Li wrote:
> In cxl_probe_component_regs() the error message "Couldn't locate the
> CXL.cache and CXL.mem capability array header." is not a critical error
> message indeed.

Instead of saying "is not a critical error message indeed", lets say "is
potentially a false positive error condition". Because if the code could
accurately identify that a CXL device is attached, and the CXL link is
established, then it defintely would be an error worth reporting.

> Downgrade the message from error level to debug level
> by using dev_dbg() to print the message, and the end users won't worry
> about the message anymore.

Agree, kernel should not be emitting error messages unless it can
concretely point to an end user visible loss of functionality.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

Dave, or Ira, can you fix up the changelog per above on applying?
Ira Weiny Oct. 25, 2024, 10 p.m. UTC | #3
Dan Williams wrote:
> [ add Dave and Ira ]
> 
> Coly Li wrote:
> > In cxl_probe_component_regs() the error message "Couldn't locate the
> > CXL.cache and CXL.mem capability array header." is not a critical error
> > message indeed.
> 
> Instead of saying "is not a critical error message indeed", lets say "is
> potentially a false positive error condition". Because if the code could
> accurately identify that a CXL device is attached, and the CXL link is
> established, then it defintely would be an error worth reporting.
> 
> > Downgrade the message from error level to debug level
> > by using dev_dbg() to print the message, and the end users won't worry
> > about the message anymore.
> 
> Agree, kernel should not be emitting error messages unless it can
> concretely point to an end user visible loss of functionality.
> 
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
> 
> Dave, or Ira, can you fix up the changelog per above on applying?

Yep.  Queued in cxl-next

Ira
diff mbox series

Patch

diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c
index e1082e749c69..026690137bc3 100644
--- a/drivers/cxl/core/regs.c
+++ b/drivers/cxl/core/regs.c
@@ -52,7 +52,7 @@  void cxl_probe_component_regs(struct device *dev, void __iomem *base,
 	cap_array = readl(base + CXL_CM_CAP_HDR_OFFSET);
 
 	if (FIELD_GET(CXL_CM_CAP_HDR_ID_MASK, cap_array) != CM_CAP_HDR_CAP_ID) {
-		dev_err(dev,
+		dev_dbg(dev,
 			"Couldn't locate the CXL.cache and CXL.mem capability array header.\n");
 		return;
 	}