From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH 1/2] i2c: rcar: avoid race condition with SMIs
Date: Sat, 21 May 2022 08:37:44 +0200 [thread overview]
Message-ID: <YoiIuBtm2cPcYK00@shikoro> (raw)
In-Reply-To: <20220520103325.81110-2-wsa+renesas@sang-engineering.com>
[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]
On Fri, May 20, 2022 at 12:33:24PM +0200, Wolfram Sang wrote:
> A customer experienced a race condition with 'repeated starts' when a
> System Management Interrupt took over for 30us and more. The problem was
> that during the SMI a new MAT interrupt came in because we set up the
> 'repeated start' condition. But the old one was not acknowledged yet.
> So, when it was acknowledged after the SMI, the new MAT interrupt was
> lost, confusing the state machine of the driver.
>
> The fix consists of two parts. First, we do not clear the status
> register for 'repeated starts' when preparing the next message anymore.
> The interrupt handlers for sending and receiving data is now solely
> responsible for that and it makes the code easier to follow, in fact.
> Secondly, clearing the status register is now split up to handle MAT
> interrupts independently. This avoids the race condition because the old
> MAT interrupt will be now cleared before we initiate the "repeated
> start" condition.
>
> Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-05-21 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 10:33 [PATCH 0/2] i2c: rcar: increase robustness against long SMIs Wolfram Sang
2022-05-20 10:33 ` [PATCH 1/2] i2c: rcar: avoid race condition with SMIs Wolfram Sang
2022-05-21 6:37 ` Wolfram Sang [this message]
2022-05-20 10:33 ` [PATCH 2/2] i2c: rcar: refactor handling of first message Wolfram Sang
2022-05-21 6:37 ` 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=YoiIuBtm2cPcYK00@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.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