From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-i3c@lists.infradead.org (moderated list:SILVACO I3C
DUAL-ROLE MASTER),
imx@lists.linux.dev (open list:SILVACO I3C DUAL-ROLE MASTER),
linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH 1/1] i3c: master: svc: skip address resend on repeat START
Date: Wed, 23 Apr 2025 09:17:43 +0200 [thread overview]
Message-ID: <87zfg75otk.fsf@bootlin.com> (raw)
In-Reply-To: <20250416164751.3437085-1-Frank.Li@nxp.com> (Frank Li's message of "Wed, 16 Apr 2025 12:47:50 -0400")
On 16/04/2025 at 12:47:50 -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>
> ---
> 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..5212c2cc6855f 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);
Could we just pass 'i' here? Or maybe 'i > 0' which might be even clearer.
> /* cmd->xfer is NULL if I2C or CCC transfer */
> if (cmd->xfer)
> cmd->xfer->actual_len = cmd->actual_len;
Thanks,
Miquèl
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-i3c@lists.infradead.org (moderated list:SILVACO I3C
DUAL-ROLE MASTER),
imx@lists.linux.dev (open list:SILVACO I3C DUAL-ROLE MASTER),
linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH 1/1] i3c: master: svc: skip address resend on repeat START
Date: Wed, 23 Apr 2025 09:17:43 +0200 [thread overview]
Message-ID: <87zfg75otk.fsf@bootlin.com> (raw)
In-Reply-To: <20250416164751.3437085-1-Frank.Li@nxp.com> (Frank Li's message of "Wed, 16 Apr 2025 12:47:50 -0400")
On 16/04/2025 at 12:47:50 -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>
> ---
> 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..5212c2cc6855f 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);
Could we just pass 'i' here? Or maybe 'i > 0' which might be even clearer.
> /* cmd->xfer is NULL if I2C or CCC transfer */
> if (cmd->xfer)
> cmd->xfer->actual_len = cmd->actual_len;
Thanks,
Miquèl
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2025-04-23 7:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 16:47 [PATCH 1/1] i3c: master: svc: skip address resend on repeat START Frank Li
2025-04-16 16:47 ` Frank Li
2025-04-23 7:17 ` Miquel Raynal [this message]
2025-04-23 7:17 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zfg75otk.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=imx@lists.linux.dev \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.