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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:18:40 +0000 (07:18 +0200)
commit1ffda54f0546c7931891b9e44a6dcf000bf0831d
tree974f5cfc4fac29555955561eba3b000b5eedaae7
parent0910434c455df15ff8c1eca024cd4146472eda08
i2c: designware: Synchronize IRQs when unregistering slave client

[ Upstream commit c486dcd2f1bbdd524a1e0149734b79e4ae329650 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-designware-slave.c