]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: npcm7xx: Fix callback completion ordering
authorWilliam A. Kennington III <william@wkennington.com>
Sun, 24 Sep 2023 01:02:14 +0000 (18:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:50 +0000 (14:56 +0200)
commit85fafa7ef0ac44959fd8ec156da6eaf4bb2a0345
tree45dd39201b9a42adc3542e6e8f00ce1ca6183876
parent0d6c2f0942c3e0bd826c24dc17d1c544f4ec82de
i2c: npcm7xx: Fix callback completion ordering

[ Upstream commit 92e73d807b68b2214fcafca4e130b5300a9d4b3c ]

Sometimes, our completions race with new master transfers and override
the bus->operation and bus->master_or_slave variables. This causes
transactions to timeout and kernel crashes less frequently.

To remedy this, we re-order all completions to the very end of the
function.

Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
Signed-off-by: William A. Kennington III <william@wkennington.com>
Reviewed-by: Tali Perry <tali.perry1@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-npcm7xx.c