public inbox for linux-i3c@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)
@ 2025-01-29 16:22 Frank Li
  2025-01-31  8:52 ` Miquel Raynal
  2025-02-20 22:20 ` Alexandre Belloni
  0 siblings, 2 replies; 4+ messages in thread
From: Frank Li @ 2025-01-29 16:22 UTC (permalink / raw)
  To: Miquel Raynal, Conor Culhane, Alexandre Belloni,
	moderated list:SILVACO I3C DUAL-ROLE MASTER, open list
  Cc: imx

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.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
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(+)

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index c1ee3828e7eec..bb660c4dcce56 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -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);
-- 
2.34.1


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)
  2025-01-29 16:22 [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA) Frank Li
@ 2025-01-31  8:52 ` Miquel Raynal
  2025-01-31 16:14   ` Frank Li
  2025-02-20 22:20 ` Alexandre Belloni
  1 sibling, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2025-01-31  8:52 UTC (permalink / raw)
  To: Frank Li
  Cc: Conor Culhane, Alexandre Belloni,
	moderated list:SILVACO I3C DUAL-ROLE MASTER, open list, imx

On 29/01/2025 at 11:22:50 -05, Frank Li <Frank.Li@nxp.com> wrote:

> 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.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> 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,

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)
  2025-01-31  8:52 ` Miquel Raynal
@ 2025-01-31 16:14   ` Frank Li
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2025-01-31 16:14 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Conor Culhane, Alexandre Belloni,
	moderated list:SILVACO I3C DUAL-ROLE MASTER, open list, imx

On Fri, Jan 31, 2025 at 09:52:48AM +0100, Miquel Raynal wrote:
> On 29/01/2025 at 11:22:50 -05, Frank Li <Frank.Li@nxp.com> wrote:
>
> > 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.
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > 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)?

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

>
> Anyway,
>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> Thanks,
> Miquèl

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA)
  2025-01-29 16:22 [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA) Frank Li
  2025-01-31  8:52 ` Miquel Raynal
@ 2025-02-20 22:20 ` Alexandre Belloni
  1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2025-02-20 22:20 UTC (permalink / raw)
  To: Miquel Raynal, linux-i3c, linux-kernel, Frank Li; +Cc: imx

On Wed, 29 Jan 2025 11:22:50 -0500, Frank Li wrote:
> 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,

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

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

end of thread, other threads:[~2025-02-20 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 16:22 [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA) Frank Li
2025-01-31  8:52 ` Miquel Raynal
2025-01-31 16:14   ` Frank Li
2025-02-20 22:20 ` Alexandre Belloni

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