lkml.org 
[lkml]   [2023]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] iio: addac: stx104: Migrate to the regmap API
On Sat, Apr 01, 2023 at 02:51:21PM +0100, Jonathan Cameron wrote:
>
> >
> > > + do {
> > > + err = regmap_read(priv->aio_ctl_map, STX104_ADC_STATUS, &adc_status);
> > > + if (err)
> > > + return err;
> > > + } while (u8_get_bits(adc_status, STX104_CNV));
> >
> > Hmm... Isn't it a potential infinite loop (e.g., ther hardware / firmware
> > is broken)?
> >
> > Why not using regmap_read_poll_timeout() (or its atomic variant, depends on
> > the case)?
>
> Just to shortcut things as I'm looking at this.
> That's currently handled in patch 2. Argument being this is a direct conversion
> of existing code, whereas changing to xxx_poll_timeout() is an improvement.
>
> I'm fine with it just being rolled into first patch with a note in the patch
> description though if that works better.

I'm going to keep it as a separate follow-up patch because introducing a
timeout is enough of a functional change to risk a regression that
having it in a dedicated commit makes it easier to revert later if we
need to.

William Breathitt Gray
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-04-01 15:44    [W:0.071 / U:5.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site