]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
i2c: xlp9xx: Fix case where SSIF read transaction completes early
authorGeorge Cherian <george.cherian@cavium.com>
Wed, 15 Aug 2018 15:58:08 +0000 (10:58 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commit73f8ca7e3eb922a724ac28750d5f92194a853d1a
tree84a24dc68be6fd100de7c10793f125d5f5efef04
parent424f5fd69525ce879b293eea48cfcf06e0c22467
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.

BugLink: https://launchpad.net/bugs/1787240
Signed-off-by: George Cherian <george.cherian@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
(cherry picked from commit 5eb173f5c8f3a3cdc47b3952c368f10a28c81ab8)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Kleber Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/i2c/busses/i2c-xlp9xx.c