Re: [PATCH V9 8/9] cxl/port: Retry reading CDAT on failure

From: Alison Schofield
Date: Tue May 31 2022 - 13:07:36 EST


On Tue, May 31, 2022 at 08:26:31AM -0700, Ira Weiny wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> The CDAT read may fail for a number of reasons but mainly it is possible
> to get different parts of a valid state. The checksum in the CDAT table
> protects against this.
>
> Now that the cdat data is validated issue a retries if the CDAT read
> fails. For now 5 retries are implemented.
>
> Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> ---

snip

> +
> +void read_cdat_data(struct cxl_port *port)
> +{
> + int retries = 5;
> + int rc;
> +
> + while (retries--) {
> + rc = __read_cdat_data(port);
> + if (!rc)
> + break;
> + dev_err(&port->dev,
> + "CDAT data read error rc=%d (retries %d)\n",
> + rc, retries);
> + }

Perhaps dev_dbg() on retries and dev_err() only when retries are exhausted.


> }
> EXPORT_SYMBOL_NS_GPL(read_cdat_data, CXL);
> --
> 2.35.1
>