From: Jonathan Cameron <jic23@kernel.org>
To: "Stan, Liviu" <Liviu.Stan@analog.com>
Cc: David Lechner <dlechner@baylibre.com>,
"Sa, Nuno" <Nuno.Sa@analog.com>,
Andy Shevchenko <andy@kernel.org>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"Miclaus, Antoniu" <Antoniu.Miclaus@analog.com>,
Francesco Lavra <flavra@baylibre.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux <linux@analog.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 8/8] iio: temperature: ltc2983: Add support for ADT7604
Date: Fri, 22 May 2026 18:31:22 +0100 [thread overview]
Message-ID: <20260522183122.12191b61@jic23-huawei> (raw)
In-Reply-To: <LV9PR03MB8366C36D83A00FFCC166E333F60F2@LV9PR03MB8366.namprd03.prod.outlook.com>
On Fri, 22 May 2026 14:24:27 +0000
"Stan, Liviu" <Liviu.Stan@analog.com> wrote:
> On Fri, 22 May 2026 14:34:44 +0100 Jonathan Cameron <jic23@kernel.org> wrote:
>
> > On Thu, 21 May 2026 19:43:01 +0300
> > Liviu Stan <liviu.stan@analog.com> wrote:
> >
> ...
> >
> > The sashiko comment about the completion race looks real to me.
> > Can you take a look at that. Might be some odd reason why we can't
> > reinit_completion() before triggering the capture but that would
> > be very unusual.
> >
>
> I don't see any reason why we couldn't put it before the regmap_write,
> it has also already been done in ltc2983_eeprom_cmd(). So, I will change
> it in v4.
>
> > Otherwise just two really small things I missed in earlier reviews.
> > If everything else was ready to go I'd have tweaked these whilst
> > applying but seems you'll be doing a v4 so over to you!
>
> Understood, will change them in v4!:) Thanks!
>
> On Fri, 22 May 2026 09:09:33 -0500 David Lechner <dlechner@baylibre.com> wrote:
>
> > On 5/22/26 8:23 AM, Liviu Stan wrote:
> > > On Thu, 21 May 2026 19:18:28 +0000 sashiko-bot@kernel.org wrote:
> > >
> > >> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> ...
> > >> [Severity: High]
> > >> This is a pre-existing issue, but can this function experience spurious
> > >> read timeouts due to a race condition with the completion?
> > >>
> > >> Looking at the rest of this function:
> > >>
> > >> ret = regmap_write(st->regmap, LTC2983_STATUS_REG, start_conversion);
> > >> if (ret)
> > >> return ret;
> > >>
> > >> reinit_completion(&st->completion);
> > >>
> > >> If the hardware conversion finishes very quickly after regmap_write(),
> > >> could the interrupt fire and call complete() before the CPU executes
> > >> reinit_completion()? This would overwrite the completion event, causing the
> > >> subsequent wait_for_completion_timeout() to spuriously time out.
> > >>
> > >> Would it be safer to call reinit_completion() before initiating the hardware
> > >> action?
> > >
> > > This is theoretically valid but in practice, the conversion requires at minimum
> > > two 82ms cycles (167ms), so there is no realistic window for the interrupt to
> > > race with reinit_completion(). What do you guys think?
> >
> > I would still move it before the write so that it looks correct
> > and others can copy/paste the logic on other devices.
>
> That makes sense. Thanks!
>
> Would this be considered a fix?
Yes, though not an urgent one given no particular reports of it being hit.
Just put it at the start of the series and I'll apply it with the rest.
Can get backported after next merge window.
Thanks,
Jonathan
>
> Liviu
prev parent reply other threads:[~2026-05-22 17:31 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 16:42 [PATCH v3 0/8] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-21 16:42 ` [PATCH v3 1/8] iio: temperature: ltc2983: Fix macro parenthesization and rename Liviu Stan
2026-05-22 9:11 ` Joshua Crofts
2026-05-22 12:56 ` Jonathan Cameron
2026-05-21 16:42 ` [PATCH v3 2/8] iio: temperature: ltc2983: Use local device pointer consistently Liviu Stan
2026-05-22 7:37 ` Joshua Crofts
2026-05-22 13:02 ` Jonathan Cameron
2026-05-22 13:56 ` Stan, Liviu
2026-06-02 23:19 ` Andy Shevchenko
2026-05-21 16:42 ` [PATCH v3 3/8] iio: temperature: ltc2983: Fix inconsistent channel wording in messages Liviu Stan
2026-05-22 7:07 ` Joshua Crofts
2026-06-02 23:21 ` Andy Shevchenko
2026-05-21 16:42 ` [PATCH v3 4/8] iio: temperature: ltc2983: Use fwnode_property_present() for optional properties Liviu Stan
2026-06-02 23:23 ` Andy Shevchenko
2026-05-21 16:42 ` [PATCH v3 5/8] iio: temperature: ltc2983: Fix n_wires default bypassing rotation check Liviu Stan
2026-05-22 13:06 ` Jonathan Cameron
2026-05-21 16:42 ` [PATCH v3 6/8] iio: core: Add IIO_COVERAGE channel type Liviu Stan
2026-05-21 18:10 ` sashiko-bot
2026-05-22 9:57 ` Stan, Liviu
2026-05-21 16:43 ` [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-21 18:23 ` sashiko-bot
2026-05-22 11:42 ` Liviu Stan
2026-05-22 13:17 ` Jonathan Cameron
2026-05-21 16:43 ` [PATCH v3 8/8] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-21 19:18 ` sashiko-bot
2026-05-22 13:23 ` Liviu Stan
2026-05-22 14:09 ` David Lechner
2026-05-22 13:34 ` Jonathan Cameron
2026-05-22 14:24 ` Stan, Liviu
2026-05-22 17:31 ` Jonathan Cameron [this message]
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=20260522183122.12191b61@jic23-huawei \
--to=jic23@kernel.org \
--cc=Antoniu.Miclaus@analog.com \
--cc=Liviu.Stan@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox