Commit 4236b082 authored by Russell King's avatar Russell King Committed by Kelsey Skunberg

i2c: pxa: clear all master action bits in i2c_pxa_stop_message()

BugLink: https://bugs.launchpad.net/bugs/1885932

[ Upstream commit e81c979f ]

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: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 4b156904
...@@ -691,11 +691,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c) ...@@ -691,11 +691,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c)
{ {
u32 icr; u32 icr;
/* /* Clear the START, STOP, ACK, TB and MA flags */
* Clear the STOP and ACK flags
*/
icr = readl(_ICR(i2c)); icr = readl(_ICR(i2c));
icr &= ~(ICR_STOP | ICR_ACKNAK); icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA);
writel(icr, _ICR(i2c)); writel(icr, _ICR(i2c));
} }
......
Markdown is supported
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