[PATCH v2 16/18] cxl/region: Show message on broken target list

Robert Richter posted 18 patches 1 year ago
There is a newer version of this series
[PATCH v2 16/18] cxl/region: Show message on broken target list
Posted by Robert Richter 1 year ago
Broken target lists are hard to discover as the driver fails at a
later initialization stage. Add an error message for this.

Signed-off-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
---
 drivers/cxl/core/region.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 606f5652114b..3b578ca167e5 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -1790,6 +1790,13 @@ static int find_pos_and_ways(struct cxl_port *port, struct range *range,
 	}
 	put_device(dev);
 
+	if (rc)
+		dev_err(port->uport_dev,
+			"failed to find %s:%s in target list of %s\n",
+			dev_name(&port->dev),
+			dev_name(port->parent_dport->dport_dev),
+			dev_name(&cxlsd->cxld.dev));
+
 	return rc;
 }
 
-- 
2.39.5
Re: [PATCH v2 16/18] cxl/region: Show message on broken target list
Posted by Alison Schofield 1 year ago
On Fri, Feb 07, 2025 at 04:37:51PM +0100, Robert Richter wrote:
> Broken target lists are hard to discover as the driver fails at a
> later initialization stage. Add an error message for this.

Hi Richard - There's 3 of these patches in a row, so I'll share
the common ask here. How about replacing vague 'Show message'
with type of message like "Add [dev_dbg() | dev_warn() | dev_err()]...
I think there is one of each flavor.

For this one, are you able to append here what it looks like
when there is a broken target list during region creation.
ie...put in context how this message fits into the full spew.

> 
> Signed-off-by: Robert Richter <rrichter@amd.com>
> Reviewed-by: Gregory Price <gourry@gourry.net>
> ---
>  drivers/cxl/core/region.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 606f5652114b..3b578ca167e5 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1790,6 +1790,13 @@ static int find_pos_and_ways(struct cxl_port *port, struct range *range,
>  	}
>  	put_device(dev);
>  
> +	if (rc)
> +		dev_err(port->uport_dev,
> +			"failed to find %s:%s in target list of %s\n",
> +			dev_name(&port->dev),
> +			dev_name(port->parent_dport->dport_dev),
> +			dev_name(&cxlsd->cxld.dev));
> +
>  	return rc;
>  }
>  
> -- 
> 2.39.5
>
Re: [PATCH v2 16/18] cxl/region: Show message on broken target list
Posted by Robert Richter 12 months ago
On 07.02.25 15:36:45, Alison Schofield wrote:
> On Fri, Feb 07, 2025 at 04:37:51PM +0100, Robert Richter wrote:
> > Broken target lists are hard to discover as the driver fails at a
> > later initialization stage. Add an error message for this.
> 
> Hi Richard - There's 3 of these patches in a row, so I'll share
> the common ask here. How about replacing vague 'Show message'
> with type of message like "Add [dev_dbg() | dev_warn() | dev_err()]...
> I think there is one of each flavor.
> 
> For this one, are you able to append here what it looks like
> when there is a broken target list during region creation.
> ie...put in context how this message fits into the full spew.

Yes, will updated the patch descriptions.

-Robert