On 6/17/20 2:25 PM, Shubhrajyoti Datta wrote: > Hi Marek, Hi, > On Sat, Jun 13, 2020 at 8:39 PM Marek Vasut <marex@xxxxxxx> wrote: >> >> The interrupt handler is missing locking when reading out registers >> and is racing with other threads which might access the driver. Drop >> it altogether, so that the threaded interrupt is always executed, as >> that one is already serialized by the driver mutex. This also allows >> dropping local_irq_save()/local_irq_restore() in xiic_start_recv(). >> > The idea of the local_irq_save / restore was to make it atomic in case > there are a lot > of non i2c interrupts. Make what atomic ? Two consecutive register writes cannot be atomic unless there is some hardware way to do that. The XIIC has no such way. > so it should still be needed right? No, if there is a mutex around both the threaded interrupt handler and this function, the register accesses will not be interleaved between the two functions. I think that is what this local_irq_*() was trying to prevent, right ?