Skip to contentSkip to conversation

i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)

PATCH Applied Frank Li 3 participants 4 messages Jan 29, 2025 – Feb 20, 2025

Subsystems (3)
lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)

Ensure the FIFO is empty before issuing the DAA command to prevent incorrect command data from being sent. Align with other data transfers, such as svc_i3c_master_start_xfer_locked(), which flushes the FIFO before sending a command.

---
Hotplug stress test find a wrong byte send out, this patch can resolve this issue although have not identify which operation cause a byte left in FIFO.

---
 drivers/i3c/master/svc-i3c-master.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/i3c/master/svc-i3c-master.c +2 -0
index c1ee3828e7eec..bb660c4dcce56 100644
@@ -892,6 +892,8 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master,
 	u32 reg;
 	int ret, i;
 
+	svc_i3c_master_flush_fifo(master);
+
 	while (true) {
 		/* clean SVC_I3C_MINT_IBIWON w1c bits */
 		writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS);
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Frank Li

Ensure the FIFO is empty before issuing the DAA command to prevent incorrect command data from being sent. Align with other data transfers, such as svc_i3c_master_start_xfer_locked(), which flushes the FIFO before sending a command.

---
Hotplug stress test find a wrong byte send out, this patch can resolve this issue although have not identify which operation cause a byte left in FIFO.

That's exactly what I understood from your commit log, I have mixed feelings about the patch because it probably hides something bigger. Not that I want to break users, but there is likely something else to do to avoid it. Is there any chance you can check the content of the FIFO and warn before flushing (at least while debugging)?

Anyway,

Thanks,
Miquèl

author maintainer
#2 lore raw
Quoted 13 lines · Miquel Raynal
Quoted 10 lines · Frank Li

Ensure the FIFO is empty before issuing the DAA command to prevent incorrect command data from being sent. Align with other data transfers, such as svc_i3c_master_start_xfer_locked(), which flushes the FIFO before sending a command.

---
Hotplug stress test find a wrong byte send out, this patch can resolve this issue although have not identify which operation cause a byte left in FIFO.

Quoted 5 lines

That's exactly what I understood from your commit log, I have mixed feelings about the patch because it probably hides something bigger. Not that I want to break users, but there is likely something else to do to avoid it. Is there any chance you can check the content of the FIFO and warn before flushing (at least while debugging)?

Yes, it is random data. We find this problem at some month ago. Still not identify why some data left in FIFO. Because it only one byte in FIFO, it hard to find pattern to identify where.

Frank

Quoted 7 lines

Anyway,

Thanks,
Miquèl

maintainer Applied
#3 lore raw
In reply to Frank Li
Quoted 6 lines · Frank Li

Ensure the FIFO is empty before issuing the DAA command to prevent incorrect command data from being sent. Align with other data transfers, such as svc_i3c_master_start_xfer_locked(), which flushes the FIFO before sending a command.

Applied, thanks!

[1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)

      https://git.kernel.org/abelloni/c/a892ee4cf22a

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com