]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: imx-lpi2c: check only for enabled interrupt flags
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Mon, 30 Jan 2023 15:32:47 +0000 (16:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:36 +0000 (11:16 +0200)
commita4677a9617f5cc1aa74285a89fbb2b38e8a5e65e
tree07d8249f216b3c142141823d910752979ee9738d
parenta1f18fc1c8e546bc200ce3917ee45d82ee73e07c
i2c: imx-lpi2c: check only for enabled interrupt flags

[ Upstream commit 1c7885004567e8951d65a983be095f254dd20bef ]

When reading from I2C, the Tx watermark is set to 0. Unfortunately the
TDF (transmit data flag) is enabled when Tx FIFO entries is equal or less
than watermark. So it is set in every case, hence the reset default of 1.
This results in the MSR_RDF _and_ MSR_TDF flags to be set thus trying
to send Tx data on a read message.
Mask the IRQ status to filter for wanted flags only.

Fixes: 90bbefd42929 ("i2c: imx-lpi2c: add low power i2c bus driver")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Tested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-imx-lpi2c.c