summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2020-05-06 10:36:38 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-25 15:32:49 +0200
commit3018d81cd983ca1d2497b13d1a2b39706db53bbf (patch)
tree20ed2780b626cd361b598143ae06e12608a68bc5 /drivers/i2c/busses
parent9ecdbfee2dc2cd78d078652db115d43565a728f8 (diff)
downloadlinux-stable-3018d81cd983ca1d2497b13d1a2b39706db53bbf.tar.gz
linux-stable-3018d81cd983ca1d2497b13d1a2b39706db53bbf.tar.bz2
linux-stable-3018d81cd983ca1d2497b13d1a2b39706db53bbf.zip
i2c: pxa: clear all master action bits in i2c_pxa_stop_message()
[ Upstream commit e81c979f4e071d516aa27cf5a0c3939da00dc1ca ] If we timeout during a message transfer, the control register may contain bits that cause an action to be set. Read-modify-writing the register leaving these bits set may trigger the hardware to attempt one of these actions unintentionally. Always clear these bits when cleaning up after a message or after a timeout. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-pxa.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index fbf91d383b40..7248ba6763e4 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -709,11 +709,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c)
{
u32 icr;
- /*
- * Clear the STOP and ACK flags
- */
+ /* Clear the START, STOP, ACK, TB and MA flags */
icr = readl(_ICR(i2c));
- icr &= ~(ICR_STOP | ICR_ACKNAK);
+ icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA);
writel(icr, _ICR(i2c));
}