Skip to content
Commit e3098ce1 authored by Chris Packham's avatar Chris Packham Committed by Greg Kroah-Hartman
Browse files

i2c: mpc: Use atomic read and fix break condition



commit a74c313a upstream.

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: 4a8ac5e4 ("i2c: mpc: Poll for MCF")
Reported-by: default avatarMaxime Bizon <mbizon@freebox.fr>
Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: default avatarMaxime Bizon <mbizon@freebox.fr>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 23a5f979
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment