]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: xlp9xx: Fix case where SSIF read transaction completes early
authorGeorge Cherian <george.cherian@cavium.com>
Thu, 9 Aug 2018 06:36:48 +0000 (23:36 -0700)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 9 Aug 2018 15:41:13 +0000 (17:41 +0200)
commitc3aedf27415417f58ff0c5d4cbdaadab79080205
treeb3e6375b12318923fe015c25f655bee29aefb462
parentdf71e18b75088bde12f4c3d5e5841e11a140d1f9
i2c: xlp9xx: Fix case where SSIF read transaction completes early

During ipmi stress tests we see occasional failure of transactions
at the boot time. This happens in the case of a I2C_M_RECV_LEN
transactions, when the read transfer completes (with the initial
read length of 34) before the driver gets a chance to handle interrupts.

The current driver code expects at least 2 interrupts for I2C_M_RECV_LEN
transactions. The length is updated during the first interrupt, and  the
buffer contents are only copied during subsequent interrupts. In case of
just one interrupt, we will complete the transaction without copying
out the bytes from RX fifo.

Update the code to drain the RX fifo after the length update,
so that the transaction completes correctly in all cases.

Signed-off-by: George Cherian <george.cherian@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-xlp9xx.c