]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mpc: Use atomic read and fix break condition
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Tue, 7 Dec 2021 04:21:44 +0000 (17:21 +1300)
committerWolfram Sang <wsa@kernel.org>
Fri, 10 Dec 2021 21:27:30 +0000 (22:27 +0100)
commit57040b0e30b2393abc93a4b31015a3d4b55ae075
tree3c41f5089c73b7d05337d8d5685aef0137c66024
parent76e0de66202b912f211ef84a019056d6bab76ccb
i2c: mpc: Use atomic read and fix break condition

Maxime points out that the polling code in mpc_i2c_isr should use the
_atomic API because it is called in an irq context and that the
behaviour of the MCF bit is that it is 1 when the byte transfer is
complete. All of this means the original code was effectively a
udelay(100).

Fix this by using readb_poll_timeout_atomic() and removing the negation
of the break condition.

Fixes: 2c68d67a3c84 ("i2c: mpc: Poll for MCF")
Reported-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mpc.c