i2c: xiic: Fix RX IRQ busy check

In case the XIIC does TX/RX transfer, make sure no other kernel thread
can start another TX transfer at the same time. This could happen since
the driver only checks tx_msg for being non-NULL and returns -EBUSY in
that case, however it is necessary to check also rx_msg for the same.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
Marek Vasut 2021-08-23 23:41:45 +02:00 committed by Wolfram Sang
parent d12e4bbb19
commit 294b29f154
1 changed files with 1 additions and 1 deletions

View File

@ -543,7 +543,7 @@ static int xiic_busy(struct xiic_i2c *i2c)
int tries = 3;
int err;
if (i2c->tx_msg)
if (i2c->tx_msg || i2c->rx_msg)
return -EBUSY;
/* In single master mode bus can only be busy, when in use by this