1 From: Russell King <rmk+kernel@armlinux.org.uk>
2 Bcc: linux@mail.armlinux.org.uk
3 Subject: [PATCH 5/7] i2c: pxa: clear all master action bits in
6 Content-Disposition: inline
7 Content-Transfer-Encoding: 8bit
8 Content-Type: text/plain; charset="utf-8"
10 If we timeout during a message transfer, the control register may
11 contain bits that cause an action to be set. Read-modify-writing the
12 register leaving these bits set may trigger the hardware to attempt
13 one of these actions unintentionally.
15 Always clear these bits when cleaning up after a message or after
18 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
20 drivers/i2c/busses/i2c-pxa.c | 6 ++----
21 1 file changed, 2 insertions(+), 4 deletions(-)
23 diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
24 index db739cce93ac..a72d07bdb793 100644
25 --- a/drivers/i2c/busses/i2c-pxa.c
26 +++ b/drivers/i2c/busses/i2c-pxa.c
27 @@ -795,11 +795,9 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c)
32 - * Clear the STOP and ACK flags
34 + /* Clear the START, STOP, ACK, TB and MA flags */
35 icr = readl(_ICR(i2c));
36 - icr &= ~(ICR_STOP | ICR_ACKNAK);
37 + icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA);
38 writel(icr, _ICR(i2c));