Skip to contentSkip to conversation

i2c: cadence: Avoid fifo clear after start

PATCH Applied Sai Pavan Boddu 2 participants 2 messages May 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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")

---
Changes for V2:
Fix commit message.

 drivers/i2c/busses/i2c-cadence.c | 1 +
 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-cadence.c +1 -0
index 4bb7d6756947..2fce3e84ba64 100644
@@ -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
Signature · 1 line
2.37.6
maintainer Applied
#1 lore raw

Hi Sai Pavan,

Quoted 9 lines · Sai Pavan Boddu

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")

pushed to i2c/i2c-host-fixes.

I will send it for pull request next week as this week is already too late and I want to see a few rounds of tests before asking Wolfram to take it.

Thanks,
Andi