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

From: Alison Schofield
Date: Fri Feb 07 2025 - 18:40:51 EST


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@xxxxxxx>
> Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>
> ---
> 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
>