i2c: npcm7xx: Fix callback completion ordering
authorWilliam A. Kennington III <william@wkennington.com>
Sun, 24 Sep 2023 01:02:14 +0000 (18:02 -0700)
committerWolfram Sang <wsa@kernel.org>
Wed, 27 Sep 2023 19:32:06 +0000 (21:32 +0200)
commit92e73d807b68b2214fcafca4e130b5300a9d4b3c
tree48f67cd004bb6b1f94a6570ce5f09b90a71499dd
parentb13e59e74ff71a1004e0508107e91e9a84fd7388
i2c: npcm7xx: Fix callback completion ordering

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>
drivers/i2c/busses/i2c-npcm7xx.c