diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2019-08-15 16:52:11 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-08-29 21:47:42 +0300 |
commit | c486dcd2f1bbdd524a1e0149734b79e4ae329650 (patch) | |
tree | 1d84dbe0a4f9cc0b40772e9abb0d25e0da7df8fa /drivers/i2c/busses/i2c-designware-slave.c | |
parent | 01641b266da33e2cc57b4ea1767ba3e24ce0846b (diff) | |
download | linux-c486dcd2f1bbdd524a1e0149734b79e4ae329650.tar.xz |
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 <krzysztof.adamski@nokia.com>
Reported-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-slave.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-slave.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c index e7f9305b2dd9..f5f001738df5 100644 --- a/drivers/i2c/busses/i2c-designware-slave.c +++ b/drivers/i2c/busses/i2c-designware-slave.c @@ -94,6 +94,7 @@ static int i2c_dw_unreg_slave(struct i2c_client *slave) dev->disable_int(dev); dev->disable(dev); + synchronize_irq(dev->irq); dev->slave = NULL; pm_runtime_put(dev->dev); |