Re: [PATCH 1/2] i2c: rcar: avoid race condition with SMIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

Applied to for-next, thanks!

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux