From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy@kernel.org>
Cc: Angelo Dureghello <adureghello@baylibre.com>,
Nuno Sa <nuno.sa@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
David Lechner <dlechner@baylibre.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2 1/2] iio: dac: adi-axi-dac: fix bus read
Date: Sat, 12 Apr 2025 14:00:46 +0100 [thread overview]
Message-ID: <20250412140046.164bb4bc@jic23-huawei> (raw)
In-Reply-To: <Z_alFXGBhFxk-h0e@smile.fi.intel.com>
On Wed, 9 Apr 2025 19:49:25 +0300
Andy Shevchenko <andy@kernel.org> wrote:
> On Wed, Apr 09, 2025 at 11:16:54AM +0200, Angelo Dureghello wrote:
> > From: Angelo Dureghello <adureghello@baylibre.com>
> >
> > Fix bus read function.
> >
> > Testing the driver, on a random basis, wrong reads was detected, mainly
> > by a wrong DAC chip ID read at first boot.
> > Before reading the expected value from the AXI regmap, need always to
> > wait for busy flag to be cleared.
>
> ...
>
> > + ret = regmap_read_poll_timeout(st->regmap,
> > + AXI_DAC_UI_STATUS_REG, ival,
> > + FIELD_GET(AXI_DAC_UI_STATUS_IF_BUSY, ival) == 0,
> > + 10, 100 * KILO);
>
> It's timeout, we have special constants for that, I believe you wanted to have
> USEC_PER_MSEC here.
This is an odd corner case. If we had a define for that 100 along the lines
of X_TIMEOUT_MSEC then I'd agree that using USEC_PER_MSEC makes complete sense.
All we have is a bare number which has no defined units. I'd just go with 100000 and
not use the units.h defines at all. They make sense when lots of zeros are involved
or for standard conversions, but to me not worth it here.
Jonathan
>
> > + if (ret)
> > + return ret;
>
next prev parent reply other threads:[~2025-04-12 13:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 9:16 [PATCH v2 0/2] iio: dac: adi-axi-dac: fix for wrong bus read Angelo Dureghello
2025-04-09 9:16 ` [PATCH v2 1/2] iio: dac: adi-axi-dac: fix " Angelo Dureghello
2025-04-09 16:49 ` Andy Shevchenko
2025-04-12 13:00 ` Jonathan Cameron [this message]
2025-04-12 18:03 ` Andy Shevchenko
2025-04-09 9:16 ` [PATCH v2 2/2] iio: dac: adi-axi-dac: use unique bus free check Angelo Dureghello
2025-04-09 16:51 ` Andy Shevchenko
2025-04-29 14:32 ` Angelo Dureghello
2025-04-29 22:05 ` Andy Shevchenko
2025-04-30 14:15 ` Angelo Dureghello
2025-04-09 13:57 ` [PATCH v2 0/2] iio: dac: adi-axi-dac: fix for wrong bus read Nuno Sá
2025-04-22 8:41 ` Angelo Dureghello
2025-05-05 11:33 ` Angelo Dureghello
2025-05-05 12:38 ` Jonathan Cameron
2025-05-19 19:03 ` Angelo Dureghello
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=20250412140046.164bb4bc@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=adureghello@baylibre.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).