2022-06-01 18:40:20

by Alison Schofield

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

On Tue, May 31, 2022 at 08:26:31AM -0700, Ira Weiny wrote:
> From: Ira Weiny <[email protected]>
>
> 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 <[email protected]>
>
> ---

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
>


2022-06-01 19:13:58

by Ira Weiny

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

On Tue, May 31, 2022 at 10:07:43AM -0700, Alison Schofield wrote:
> On Tue, May 31, 2022 at 08:26:31AM -0700, Ira Weiny wrote:
> > From: Ira Weiny <[email protected]>
> >
> > 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 <[email protected]>
> >
> > ---
>
> 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.

Yes thanks!
Ira

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