Skip to content

Commit c486dcd

Browse files
jhnikulaWolfram Sang
authored andcommitted
i2c: designware: Synchronize IRQs when unregistering slave client
Make sure interrupt handler i2c_dw_irq_handler_slave() has finished before clearing the the dev->slave pointer in i2c_dw_unreg_slave(). There is possibility for a race if i2c_dw_irq_handler_slave() is running on another CPU while clearing the dev->slave pointer. Reported-by: Krzysztof Adamski <[email protected]> Reported-by: Wolfram Sang <[email protected]> Signed-off-by: Jarkko Nikula <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 01641b2 commit c486dcd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/i2c/busses/i2c-designware-slave.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static int i2c_dw_unreg_slave(struct i2c_client *slave)
9494

9595
dev->disable_int(dev);
9696
dev->disable(dev);
97+
synchronize_irq(dev->irq);
9798
dev->slave = NULL;
9899
pm_runtime_put(dev->dev);
99100

0 commit comments

Comments
 (0)