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 --- a/drivers/i2c/busses/i2c-pxa.c
24 +++ b/drivers/i2c/busses/i2c-pxa.c
25 @@ -754,11 +754,9 @@ static inline void i2c_pxa_stop_message(
30 - * Clear the STOP and ACK flags
32 + /* Clear the START, STOP, ACK, TB and MA flags */
33 icr = readl(_ICR(i2c));
34 - icr &= ~(ICR_STOP | ICR_ACKNAK);
35 + icr &= ~(ICR_START | ICR_STOP | ICR_ACKNAK | ICR_TB | ICR_MA);
36 writel(icr, _ICR(i2c));