Skip to content

Commit 1ca1b45

Browse files
rayagondawsakernel
authored andcommitted
i2c: iproc: handle Master aborted error
Handle Master aborted error by flushing tx and rx fifo and reinitializing the hw. Signed-off-by: Rayagonda Kokatanur <[email protected]> Acked-by: Ray Jui <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 9c975c4 commit 1ca1b45

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/i2c/busses/i2c-bcm-iproc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
#define S_CMD_STATUS_MASK 0x07
9494
#define S_CMD_STATUS_SUCCESS 0x0
9595
#define S_CMD_STATUS_TIMEOUT 0x5
96+
#define S_CMD_STATUS_MASTER_ABORT 0x7
9697

9798
#define IE_OFFSET 0x38
9899
#define IE_M_RX_FIFO_FULL_SHIFT 31
@@ -311,9 +312,10 @@ static void bcm_iproc_i2c_check_slave_status(
311312
return;
312313

313314
val = (val >> S_CMD_STATUS_SHIFT) & S_CMD_STATUS_MASK;
314-
if (val == S_CMD_STATUS_TIMEOUT) {
315-
dev_err(iproc_i2c->device, "slave random stretch time timeout\n");
316-
315+
if (val == S_CMD_STATUS_TIMEOUT || val == S_CMD_STATUS_MASTER_ABORT) {
316+
dev_err(iproc_i2c->device, (val == S_CMD_STATUS_TIMEOUT) ?
317+
"slave random stretch time timeout\n" :
318+
"Master aborted read transaction\n");
317319
/* re-initialize i2c for recovery */
318320
bcm_iproc_i2c_enable_disable(iproc_i2c, false);
319321
bcm_iproc_i2c_slave_init(iproc_i2c, true);

0 commit comments

Comments
 (0)