summary refs log tree commit diff
path: root/drivers/char/lp.c
diff options
context:
space:
mode:
authorMarek BehĂșn <kabel@kernel.org>2023-05-21 14:19:40 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-14 11:15:31 +0200
commitf24cb5a04270bb85130a417d157e5860940e95d3 (patch)
treeb31bc3468f8ab32a4ab1cdc51741895581f86983 /drivers/char/lp.c
parent8e64012c034831b3aad8597217c28086dee62a7b (diff)
downloadlinux-f24cb5a04270bb85130a417d157e5860940e95d3.tar.gz
i2c: mv64xxx: Fix reading invalid status value in atomic mode
[ Upstream commit 5578d0a79b6430fa1543640dd6f2d397d0886ce7 ]

There seems to be a bug within the mv64xxx I2C controller, wherein the
status register may not necessarily contain valid value immediately
after the IFLG flag is set in the control register.

My theory is that the controller:
- first sets the IFLG in control register
- then updates the status register
- then raises an interrupt

This may sometime cause weird bugs when in atomic mode, since in this
mode we do not wait for an interrupt, but instead we poll the control
register for IFLG and read status register immediately after.

I encountered -ENXIO from mv64xxx_i2c_fsm() due to this issue when using
this driver in atomic mode.

Note that I've only seen this issue on Armada 385, I don't know whether
other SOCs with this controller are also affected. Also note that this
fix has been in U-Boot for over 4 years [1] without anybody complaining,
so it should not cause regressions.

[1] https://source.denx.de/u-boot/u-boot/-/commit/d50e29662f78

Fixes: 544a8d75f3d6 ("i2c: mv64xxx: Add atomic_xfer method to driver")
Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/char/lp.c')
0 files changed, 0 insertions, 0 deletions