OSDN Git Service

i2c: designware: Synchronize IRQs when unregistering slave client
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Thu, 15 Aug 2019 13:52:11 +0000 (16:52 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 29 Aug 2019 18:47:42 +0000 (20:47 +0200)
commitc486dcd2f1bbdd524a1e0149734b79e4ae329650
tree1d84dbe0a4f9cc0b40772e9abb0d25e0da7df8fa
parent01641b266da33e2cc57b4ea1767ba3e24ce0846b
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>
drivers/i2c/busses/i2c-designware-slave.c