]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: uniphier-f: make driver robust against concurrency
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 16 Oct 2018 03:01:47 +0000 (12:01 +0900)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 29 Oct 2018 18:53:37 +0000 (18:53 +0000)
commit760b0765c01cbc0287f2452fabb362421bb84612
tree2e30f3ef1dd453403186443b6ba7580c580aef22
parent81e1bed9a701681a4a69f623eda9b8e0af7f5652
i2c: uniphier-f: make driver robust against concurrency

This is unlikely to happen, but it is possible for a CPU to enter
the interrupt handler just after wait_for_completion_timeout() has
expired. If this happens, the hardware is accessed from multiple
contexts concurrently.

Disable the IRQ after wait_for_completion_timeout(), and do nothing
from the handler when the IRQ is disabled.

Fixes: c33141b65282 ("i2c: uniphier_f: add UniPhier FIFO-builtin I2C driver")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-uniphier-f.c