Linux I2C development
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: "Marek Behún" <kabel@kernel.org>
Cc: linux-i2c@vger.kernel.org,
	Gregory CLEMENT <gregory.clement@bootlin.com>,
	Samuel Holland <samuel@sholland.org>,
	Chris Morgan <macromorgan@hotmail.com>,
	Russell King <rmk+kernel@armlinux.org.uk>
Subject: Re: [PATCH] i2c: mv64xxx: Fix reading invalid status value in atomic mode
Date: Mon, 5 Jun 2023 12:23:06 +0200	[thread overview]
Message-ID: <ZH23iq1u5jEtsC8W@shikoro> (raw)
In-Reply-To: <20230521121940.27057-1-kabel@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

On Sun, May 21, 2023 at 02:19:40PM +0200, Marek Behún wrote:
> There seems to be a bug within the mv64xxx I2C controller, wherein the
> status register may not necessarily contain valid value immediately
> after the IFLG flag is set in the control register.
> 
> My theory is that the controller:
> - first sets the IFLG in control register
> - then updates the status register
> - then raises an interrupt
> 
> This may sometime cause weird bugs when in atomic mode, since in this
> mode we do not wait for an interrupt, but instead we poll the control
> register for IFLG and read status register immediately after.
> 
> I encountered -ENXIO from mv64xxx_i2c_fsm() due to this issue when using
> this driver in atomic mode.
> 
> Note that I've only seen this issue on Armada 385, I don't know whether
> other SOCs with this controller are also affected. Also note that this
> fix has been in U-Boot for over 4 years [1] without anybody complaining,
> so it should not cause regressions.
> 
> [1] https://source.denx.de/u-boot/u-boot/-/commit/d50e29662f78
> 
> Fixes: 544a8d75f3d6 ("i2c: mv64xxx: Add atomic_xfer method to driver")
> Signed-off-by: Marek Behún <kabel@kernel.org>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2023-06-05 10:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 12:19 [PATCH] i2c: mv64xxx: Fix reading invalid status value in atomic mode Marek Behún
2023-05-24 16:24 ` Chris Morgan
2023-06-05 10:23 ` Wolfram Sang [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=ZH23iq1u5jEtsC8W@shikoro \
    --to=wsa@kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=kabel@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=macromorgan@hotmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=samuel@sholland.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