mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i2c: cadence: Avoid fifo clear after start
@ 2024-01-05 12:52 Sai Pavan Boddu
  2024-01-10 16:00 ` Michal Simek
  2024-01-17 13:19 ` Andi Shyti
  0 siblings, 2 replies; 7+ messages in thread
From: Sai Pavan Boddu @ 2024-01-05 12:52 UTC (permalink / raw)
  To: linux-kernel, linux-i2c, linux-arm-kernel
  Cc: Michal Simek, Andi Shyti, Lars-Peter Clausen, Wolfram Sang

Driver unintentionally programs ctrl reg to clear fifo which is
happening after start of transaction, this was not the case previously
as it was read-modified-write. This issue breaks i2c reads on QEMU as
i2c-read is done before guest starts programming ctrl register.

Fixes: ff0cf7bca6309 ("i2c: cadence: Remove unnecessary register reads")
Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@amd.com>
---
 drivers/i2c/busses/i2c-cadence.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index de3f58b60dce..6f7d753a8197 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
-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-03 10:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-05 12:52 [PATCH] i2c: cadence: Avoid fifo clear after start Sai Pavan Boddu
2024-01-10 16:00 ` Michal Simek
2024-01-17 13:19 ` Andi Shyti
2024-01-17 18:06   ` Boddu, Sai Pavan
2024-01-17 21:05     ` Andi Shyti
2024-05-03  9:05       ` Boddu, Sai Pavan
2024-05-03 10:48         ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®