diff options
author | Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> | 2020-11-02 04:54:28 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-01-05 17:15:08 +0100 |
commit | 1ca1b4516088c4e275e47efd3cb243023388753c (patch) | |
tree | 71f998d43bab47b58eee2cf44e1851744ac31192 /drivers/i2c/busses/i2c-bcm-iproc.c | |
parent | i2c: rcar: protect against supurious interrupts on V3U (diff) | |
download | linux-1ca1b4516088c4e275e47efd3cb243023388753c.tar.xz linux-1ca1b4516088c4e275e47efd3cb243023388753c.zip |
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 <rayagonda.kokatanur@broadcom.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-bcm-iproc.c')
-rw-r--r-- | drivers/i2c/busses/i2c-bcm-iproc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index d8295b1c379d..834a98caeada 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -93,6 +93,7 @@ #define S_CMD_STATUS_MASK 0x07 #define S_CMD_STATUS_SUCCESS 0x0 #define S_CMD_STATUS_TIMEOUT 0x5 +#define S_CMD_STATUS_MASTER_ABORT 0x7 #define IE_OFFSET 0x38 #define IE_M_RX_FIFO_FULL_SHIFT 31 @@ -311,9 +312,10 @@ static void bcm_iproc_i2c_check_slave_status( return; val = (val >> S_CMD_STATUS_SHIFT) & S_CMD_STATUS_MASK; - if (val == S_CMD_STATUS_TIMEOUT) { - dev_err(iproc_i2c->device, "slave random stretch time timeout\n"); - + if (val == S_CMD_STATUS_TIMEOUT || val == S_CMD_STATUS_MASTER_ABORT) { + dev_err(iproc_i2c->device, (val == S_CMD_STATUS_TIMEOUT) ? + "slave random stretch time timeout\n" : + "Master aborted read transaction\n"); /* re-initialize i2c for recovery */ bcm_iproc_i2c_enable_disable(iproc_i2c, false); bcm_iproc_i2c_slave_init(iproc_i2c, true); |