]> git.baikalelectronics.ru Git - kernel.git/commit
i2c-tegra: fix possible race condition after tx
authorDoug Anderson <dianders@chromium.org>
Tue, 30 Aug 2011 17:46:10 +0000 (11:46 -0600)
committerBen Dooks <ben-linux@fluff.org>
Tue, 6 Sep 2011 23:13:40 +0000 (00:13 +0100)
commitfd244d13c346482d86fc9b78f745a29b930f560b
tree9b46e7ee94f9db13a414ec2e445c8a0551aa3982
parent6acf022b898d08dde28b2cae2530ecadf8fc80f8
i2c-tegra: fix possible race condition after tx

In tegra_i2c_fill_tx_fifo, once we have finished pushing all the bytes
to the I2C hardware controller, the interrupt might happen before we
have updated i2c_dev->msg_buf_remaining at the end of the function.
Then, in tegra_i2c_isr, we will call again tegra_i2c_fill_tx_fifo
triggering weird behaviour. This has been shown to happen under real
conditions.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
drivers/i2c/busses/i2c-tegra.c