public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] i3c: master: svc: skip address resend on repeat START
@ 2025-04-29  5:42 Frank Li
  2025-05-12  9:25 ` Miquel Raynal
  2025-05-15  9:56 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Frank Li @ 2025-04-29  5:42 UTC (permalink / raw)
  To: Miquel Raynal, Alexandre Belloni,
	moderated list:SILVACO I3C DUAL-ROLE MASTER,
	open list:SILVACO I3C DUAL-ROLE MASTER, open list
  Cc: imx

According to the I3C specification, address arbitration only happens during
the START. Repeated START do not initiate arbitration, and In-Band
Interrupts (IBIs) cannot occur at this stage.

Resending the address upon a NACK in a repeat START is therefore redundant
and unnecessary. Avoid redundant retries, improving efficiency and ensuring
protocol compliance.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
change from v1 to v2
- change !!i  to i > 0
---
 drivers/i3c/master/svc-i3c-master.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 85e16de208d3b..c5e4f7c0f47e2 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -1281,9 +1281,9 @@ static int svc_i3c_master_write(struct svc_i3c_master *master,
 static int svc_i3c_master_xfer(struct svc_i3c_master *master,
 			       bool rnw, unsigned int xfer_type, u8 addr,
 			       u8 *in, const u8 *out, unsigned int xfer_len,
-			       unsigned int *actual_len, bool continued)
+			       unsigned int *actual_len, bool continued, bool repeat_start)
 {
-	int retry = 2;
+	int retry = repeat_start ? 1 : 2;
 	u32 reg;
 	int ret;
 
@@ -1468,7 +1468,7 @@ static void svc_i3c_master_start_xfer_locked(struct svc_i3c_master *master)
 		ret = svc_i3c_master_xfer(master, cmd->rnw, xfer->type,
 					  cmd->addr, cmd->in, cmd->out,
 					  cmd->len, &cmd->actual_len,
-					  cmd->continued);
+					  cmd->continued, i > 0);
 		/* cmd->xfer is NULL if I2C or CCC transfer */
 		if (cmd->xfer)
 			cmd->xfer->actual_len = cmd->actual_len;
-- 
2.34.1


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

* Re: [PATCH v2 1/1] i3c: master: svc: skip address resend on repeat START
  2025-04-29  5:42 [PATCH v2 1/1] i3c: master: svc: skip address resend on repeat START Frank Li
@ 2025-05-12  9:25 ` Miquel Raynal
  2025-05-15  9:56 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2025-05-12  9:25 UTC (permalink / raw)
  To: Frank Li
  Cc: Alexandre Belloni, moderated list:SILVACO I3C DUAL-ROLE MASTER,
	open list:SILVACO I3C DUAL-ROLE MASTER, open list

On 29/04/2025 at 01:42:34 -04, Frank Li <Frank.Li@nxp.com> wrote:

> According to the I3C specification, address arbitration only happens during
> the START. Repeated START do not initiate arbitration, and In-Band
> Interrupts (IBIs) cannot occur at this stage.
>
> Resending the address upon a NACK in a repeat START is therefore redundant
> and unnecessary. Avoid redundant retries, improving efficiency and ensuring
> protocol compliance.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---

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

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

* Re: [PATCH v2 1/1] i3c: master: svc: skip address resend on repeat START
  2025-04-29  5:42 [PATCH v2 1/1] i3c: master: svc: skip address resend on repeat START Frank Li
  2025-05-12  9:25 ` Miquel Raynal
@ 2025-05-15  9:56 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2025-05-15  9:56 UTC (permalink / raw)
  To: Miquel Raynal, linux-i3c, imx, linux-kernel, Frank Li; +Cc: imx

On Tue, 29 Apr 2025 01:42:34 -0400, Frank Li wrote:
> According to the I3C specification, address arbitration only happens during
> the START. Repeated START do not initiate arbitration, and In-Band
> Interrupts (IBIs) cannot occur at this stage.
> 
> Resending the address upon a NACK in a repeat START is therefore redundant
> and unnecessary. Avoid redundant retries, improving efficiency and ensuring
> protocol compliance.
> 
> [...]

Applied, thanks!

[1/1] i3c: master: svc: skip address resend on repeat START
      https://git.kernel.org/abelloni/c/12cbd1573448

Best regards,

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

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

end of thread, other threads:[~2025-05-15  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-29  5:42 [PATCH v2 1/1] i3c: master: svc: skip address resend on repeat START Frank Li
2025-05-12  9:25 ` Miquel Raynal
2025-05-15  9:56 ` Alexandre Belloni

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