From: Thilo Zirnstein <thi.zirnstein@gmail.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: michal.simek@amd.com, linux-arm-kernel@lists.infradead.org,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Subject: Re: [PATCH v4 1/2] i2c: i2c-xiic: fix clearing of bnb irq
Date: Thu, 19 Nov 2026 10:34:54 +0100 [thread overview]
Message-ID: <av7CvgS20rBjsJHx@thi-server.fritz.box> (raw)
In-Reply-To: <av2jSyTFI1VoyGSU@zenone.zhora.eu>
On Wed, Nov 18, 2026 at 02:22:18PM +0100, Andi Shyti wrote:
Hi Andi,
Thank you for your review and feedback
> Hi Thilo,
>
> ...
>
> > + ret = read_poll_timeout_atomic(xiic_getreg8, sr,
> > + sr & XIIC_SR_BUS_BUSY_MASK, 0, XIIC_BB_TIMEOUT_US, 0,
> > + i2c, XIIC_SR_REG_OFFSET);
>
> this is a bit of an overkill: you are forcing tight loops for
> 1ms. If you consider that the minimum wait is 1ns, in 1ms you
> will end up busy looping a lot of time. Please, don't set the
> delay_us to '0', but calculate a proper waiting time between
> reads.
>
I also had doubts about whether this approach is too heavy.
I have general concerns about the busy-waiting in atomic context
in this patches, though I noticed other I2C adapters wait
for relatively long periods there as well.
The tight loops in patch 2/2 are even longer.
Those waits are longer because the code waits for the entire I2C transfer
to finish, but polling is unavoidable there since sleeping or scheduling
deferred work is not possible in atomic context—is that right?
So this kind of builtin if doing i2c transfer in atomic context ?
I will reduce the maximum poll timeout to 4 µs,
which matches the minimum I2C START condition hold time
in standard mode and seems reasonable.
I will also increase delay_us. Out of curiosity,
what is the reasoning behind the delay interval?
I assume we want to avoid hammering shared buses
or registers with continuous I/O reads.
> Andi
kind regards,
Thilo
next prev parent reply other threads:[~2026-11-19 9:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 10:11 [RESEND PATCH v4 0/2] i2c: i2c-xiic: fix clearing of bnb irq and waiting/ clearing while atomic Thilo Zirnstein
2026-11-18 10:11 ` [PATCH v4 1/2] i2c: i2c-xiic: fix clearing of bnb irq Thilo Zirnstein
2026-11-18 13:22 ` Andi Shyti
2026-11-19 9:34 ` Thilo Zirnstein [this message]
2026-11-18 10:11 ` [PATCH v4 2/2] i2c: i2c-xiic: fix waiting/clearing while atomic Thilo Zirnstein
-- strict thread matches above, loose matches on Subject: below --
2026-11-02 9:32 [PATCH v4 0/2] i2c: i2c-xiic: fix clearing of bnb irq and waiting/ clearing " Thilo Zirnstein
2026-11-02 9:32 ` [PATCH v4 1/2] i2c: i2c-xiic: fix clearing of bnb irq Thilo Zirnstein
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=av7CvgS20rBjsJHx@thi-server.fritz.box \
--to=thi.zirnstein@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=shubhrajyoti.datta@amd.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