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)
commitf1fdcbbdf45d9609f3d4063b67e9ea941ba3a58f
tree2e30f3ef1dd453403186443b6ba7580c580aef22
parenta560ae55dcc3ae43c0c5764c745d3d1f0257beee
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: 6a62974b667f ("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