Re: [PATCH RFT] i2c: emev2: avoid race when unregistering slave client

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

 



On Thu, Aug 08, 2019 at 09:54:17PM +0200, Wolfram Sang wrote:
>After we disabled interrupts, there might still be an active one
>running. Sync before clearing the pointer to the slave device.
>
>Fixes: c31d0a00021d ("i2c: emev2: add slave support")
>Reported-by: Krzysztof Adamski <krzysztof.adamski@xxxxxxxxx>
>Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
>---
>
>Not tested on hardware yet. If someone has the board set up, testing if
>standard I2C communication works would be nice. That would mean irq
>setup did not regress. The actual race is more complicated to trigger.
>If noone has the board, I will fetch it from my repository. It is packed
>away currently.

I don't see how this could influence the standard I2C communication at
all. If change in em_i2c_unreg_slave() is excluded, all that was changed
is moving irq number from local variable to the em_i2c_device struct
which is also not used outside of the em_i2c_unreg_slave() appart from
logging :)

Then, if we consider em_i2c_unreg_slave() I also don't see how this
could regres as no locks are being held in this function so calling
synchronize_irq() should be safe.

So from my point of view:
Reviewed-by: Krzysztof Adamski <krzysztof.adamski@xxxxxxxxx>

Krzysztof




[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