From: Thilo Zirnstein <thi.zirnstein@gmail.com>
To: Shubhrajyoti Datta <shubhrajyoti.datta@gmail.com>
Cc: michal.simek@amd.com, andi.shyti@kernel.org,
linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] i2c: i2c-xiic: fix waiting/clearing while atomic
Date: Mon, 2 Nov 2026 10:04:45 +0100 [thread overview]
Message-ID: <auhSLVHIh8mv-KUA@thi-server.fritz.box> (raw)
In-Reply-To: <CAKfKVtEOOGsJSV0_im=-0u=N=fxkDuCMnAzt=1ZfBs4A4rg_0g@mail.gmail.com>
Hi Shubhrajyoti,
Thanks for your review.
On Fri, Oct 30, 2026 at 08:16:34PM +0530, Shubhrajyoti Datta wrote:
> On Fri, Oct 16, 2026 at 6:24 PM Thilo Zirnstein <thi.zirnstein@gmail.com> wrote:
> >
> > Use non jiffies based waiting functions,
> > if in atomic context.
> >
> > Suggested-by: Andi Shyti <andi.shyti@kernel.org>
> > Signed-off-by: Thilo Zirnstein <thi.zirnstein@gmail.com>
> > ---
> > drivers/i2c/busses/i2c-xiic.c | 28 +++++++++++++++++++++++-----
> > 1 file changed, 23 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> > index e68e17bdf0ba..fc9a0628cb67 100644
> > --- a/drivers/i2c/busses/i2c-xiic.c
> > +++ b/drivers/i2c/busses/i2c-xiic.c
> > @@ -359,16 +359,28 @@ static inline void xiic_irq_clr_en(struct xiic_i2c *i2c, u32 mask)
> > xiic_irq_en(i2c, mask);
> > }
> >
> > +static int xiic_poll_rx_empty(struct xiic_i2c *i2c)
> > +{
> > + if (xiic_getreg8(i2c, XIIC_SR_REG_OFFSET) &
> > + XIIC_SR_RX_FIFO_EMPTY_MASK)
> > + return 1;
> > +
> > + xiic_getreg8(i2c, XIIC_DRR_REG_OFFSET);
> > + return 0;
> > +}
> > +
> > static int xiic_clear_rx_fifo(struct xiic_i2c *i2c)
> > {
> > - u8 sr;
> > + int rx_empty;
> > unsigned long timeout;
> >
> > + if (i2c->atomic)
> > + return read_poll_timeout_atomic(xiic_poll_rx_empty,
> > + rx_empty, rx_empty, 10, XIIC_I2C_TIMEOUT,
> > + 0, i2c);
> > +
> read_poll_timeout_atomic() expects its timeout argument in
> microseconds the current one is jiffies. Can you check it.
Ack
kind regards,
Thilo
prev parent reply other threads:[~2026-11-02 9:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 12:52 [PATCH v3 0/2] i2c: i2c-xiic: fix clearing of bnb irq and waiting/ clearing " Thilo Zirnstein
2026-10-16 12:52 ` [PATCH v3 1/2] i2c: i2c-xiic: fix clearing of bnb irq Thilo Zirnstein
2026-10-21 6:15 ` Shubhrajyoti Datta
2026-10-16 12:52 ` [PATCH v3 2/2] i2c: i2c-xiic: fix waiting/clearing while atomic Thilo Zirnstein
2026-10-30 14:46 ` Shubhrajyoti Datta
2026-11-02 9:04 ` Thilo Zirnstein [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=auhSLVHIh8mv-KUA@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@gmail.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
all inboxes | Powered by JetHome®