summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-cadence.c
diff options
context:
space:
mode:
authorSai Pavan Boddu <sai.pavan.boddu@amd.com>2024-05-03 12:42:08 +0300
committerAndi Shyti <andi.shyti@kernel.org>2024-05-06 01:36:12 +0300
commitc2e55b449de7298a751ed0256251019d302af453 (patch)
treee686732ce1e1d57a4c9656a4fbfa8a4db2ddc295 /drivers/i2c/busses/i2c-cadence.c
parentdd5a440a31fae6e459c0d6271dddd62825505361 (diff)
downloadlinux-c2e55b449de7298a751ed0256251019d302af453.tar.xz
i2c: cadence: Avoid fifo clear after start
The Driver unintentionally programs ctrl reg to clear the fifo, which happens after the start of transaction. Previously, this was not an issue as it involved read-modified-write. However, this issue breaks i2c reads on QEMU, as i2c-read is executed before guest starts programming control register. Fixes: ff0cf7bca630 ("i2c: cadence: Remove unnecessary register reads") Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@amd.com> Acked-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-cadence.c')
-rw-r--r--drivers/i2c/busses/i2c-cadence.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 4bb7d6756947..2fce3e84ba64 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -633,6 +633,7 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
if (hold_clear) {
ctrl_reg &= ~CDNS_I2C_CR_HOLD;
+ ctrl_reg &= ~CDNS_I2C_CR_CLR_FIFO;
/*
* In case of Xilinx Zynq SOC, clear the HOLD bit before transfer size
* register reaches '0'. This is an IP bug which causes transfer size