All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Dmitry Guzman <Dmitry.Guzman@mobileye.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	srinidhi kasagar <srinidhi.kasagar@stericsson.com>,
	Ben Dooks <ben-linux@fluff.org>,
	Andrea Gallo <andrea.gallo@stericsson.com>,
	linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/8] i2c: nomadik: reduce FIFO flush timeout to avoid long interrupt handling
Date: Sun, 8 Nov 2026 11:19:17 +0100	[thread overview]
Message-ID: <avBMpSKHPnsz4vMR@shikoro> (raw)
In-Reply-To: <CAD++jLnLz_Y_W3Yg13WNntN=iy8tzxAWN4Z0rr5YnO2QfYdrCg@mail.gmail.com>


> > In flush_i2c_fifo(), the driver sets FTX and FRX flags and waits until
> > they are reset (these bits are self-clearing). If after the first read
> > one or both of these bits is set, it waits until both are reset. The
> > timeout is 10 * I2C transfer timeout. I2C transfer timeout is by default
> > 200 milliseconds. 2 seconds are much more than needed: as stated in the
> > comment above, the flushing operation takes just several cycles before
> > completed.
> >
> > flush_i2c_fifo() is called from init_hw() that may be called from
> > interrupt handler. So, if the I2C controller is stuck and the FIFO does
> > not get flushed, the CPU may spend up to 2 seconds in the interrupt
> > handler and cause watchdog timeout or other unwanted consequences.
> > Moreover, if the interrupt is handled by the same CPU core that updates
> > jiffies, the loop may not finish at all.
> >
> > To avoid too long waiting, reduce the timeout to 100 microseconds and
> > use read_poll_timeout_atomic() instead of relying on jiffies.
> >
> > Fixes: 3f9900f17cdb ("i2c: Add support for Ux500/Nomadik I2C controller")
> 
> Is it really "fixing" that? I don't know if I agree that this is an error
> in the initial submission in 2010...

Removed it.

> > Signed-off-by: Dmitry Guzman <Dmitry.Guzman@mobileye.com>
> 
> Surplus newline above? Maintainer can remove it when applying.

Fixed this.

Thanks for the reviews, Linus.


  reply	other threads:[~2026-11-08 10:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  8:29 [PATCH 0/8] i2c: nomadik: fix several issues in fault handling, optimize layout Dmitry Guzman
2026-11-03  8:29 ` [PATCH 1/8] i2c: nomadik: optimize struct layout, change unsigned char into u8 Dmitry Guzman
2026-11-03  8:29 ` [PATCH 2/8] i2c: nomadik: do not try to retransmit I2C message series on errors Dmitry Guzman
2026-11-03  8:29 ` [PATCH 3/8] i2c: nomadik: return proper fault codes Dmitry Guzman
2026-11-03  8:29 ` [PATCH 4/8] i2c: nomadik: change print level for fault messages to debug Dmitry Guzman
2026-11-03  8:29 ` [PATCH 5/8] i2c: nomadik: add quirks max_len=2047 and no_zero_len_read Dmitry Guzman
2026-11-05  8:40   ` Linus Walleij
2026-11-03  8:29 ` [PATCH 6/8] i2c: nomadik: handle pm_runtime errors Dmitry Guzman
2026-11-05  8:42   ` Linus Walleij
2026-11-05  8:51     ` Wolfram Sang
2026-11-08 10:27       ` Wolfram Sang
2026-11-09  7:03   ` Wolfram Sang
2026-11-09  7:15     ` Wolfram Sang
2026-11-09  8:06       ` Dmitry Guzman
2026-11-09 17:25         ` Wolfram Sang
2026-11-09 20:38           ` Wolfram Sang
2026-11-03  8:29 ` [PATCH 7/8] i2c: nomadik: fix race condition with interrupt handler Dmitry Guzman
2026-11-05  8:42   ` Linus Walleij
2026-11-03  8:29 ` [PATCH 8/8] i2c: nomadik: reduce FIFO flush timeout to avoid long interrupt handling Dmitry Guzman
2026-11-05  8:44   ` Linus Walleij
2026-11-08 10:19     ` Wolfram Sang [this message]
2026-11-08 10:16 ` [PATCH 0/8] i2c: nomadik: fix several issues in fault handling, optimize layout Wolfram Sang

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=avBMpSKHPnsz4vMR@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=Dmitry.Guzman@mobileye.com \
    --cc=andi.shyti@kernel.org \
    --cc=andrea.gallo@stericsson.com \
    --cc=ben-linux@fluff.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinidhi.kasagar@stericsson.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 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.