All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Breathitt Gray <william.gray@linaro.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] iio: addac: stx104: Migrate to the regmap API
Date: Sat, 1 Apr 2023 09:43:51 -0400	[thread overview]
Message-ID: <ZCg1FyfcOvpLrMmH@fedora> (raw)
In-Reply-To: <20230401145121.1a64a113@jic23-huawei>

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-04-01 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 22:05 [PATCH v3 0/2] Migrate STX104 to the regmap API William Breathitt Gray
2023-03-26 22:05 ` [PATCH v3 1/2] iio: addac: stx104: Migrate " William Breathitt Gray
2023-03-27 11:42   ` Andy Shevchenko
2023-04-01 13:49     ` Jonathan Cameron
2023-04-01 13:51     ` Jonathan Cameron
2023-04-01 13:43       ` William Breathitt Gray [this message]
2023-04-01 14:06     ` William Breathitt Gray
2023-04-02 16:46       ` Jonathan Cameron
2023-04-02 14:51         ` William Breathitt Gray
2023-03-26 22:05 ` [PATCH v3 2/2] iio: addac: stx104: Use regmap_read_poll_timeout() for conversion poll William Breathitt Gray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZCg1FyfcOvpLrMmH@fedora \
    --to=william.gray@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.