提交 7ece33a0 编写于 作者: J Jarkko Nikula 提交者: Xie XiuQi

i2c: designware: Synchronize IRQs when unregistering slave client

mainline inclusion
from mainline-5.3-rc7
commit c486dcd2f1bb
category: bugfix
bugzilla: 20960
CVE: NA

-------------------------------------------------

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: NKrzysztof Adamski <krzysztof.adamski@nokia.com>
Reported-by: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8fd9f584
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册