mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chuys@gmail.com>
To: frank.li@nxp.com, miquel.raynal@bootlin.com,
	alexandre.belloni@bootlin.com, linux-i3c@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, tomer.maimon@nuvoton.com,
	kwliu@nuvoton.com, yschu@nuvoton.com
Subject: [PATCH v1] i3c: master: svc: Update actual read length
Date: Tue,  1 Apr 2025 14:34:06 +0800	[thread overview]
Message-ID: <20250401063406.3728534-1-yschu@nuvoton.com> (raw)

From: Stanley Chu <yschu@nuvoton.com>

Some drivers, such as mctp-i3c.c, reuse the i3c_priv_xfer.len as
the actual read len. Therefore, the controller driver should also
update the i3c_priv_xfer.len after the read transfer is completed.

Signed-off-by: Stanley Chu <yschu@nuvoton.com>
---
 drivers/i3c/master/svc-i3c-master.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 85e16de208d3..dd520f5d4c9f 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -1470,9 +1470,16 @@ static void svc_i3c_master_start_xfer_locked(struct svc_i3c_master *master)
 					  cmd->len, &cmd->actual_len,
 					  cmd->continued);
 		/* cmd->xfer is NULL if I2C or CCC transfer */
-		if (cmd->xfer)
+		if (cmd->xfer) {
 			cmd->xfer->actual_len = cmd->actual_len;
 
+			/*
+			 * Some i3c drivers reuse i3c_priv_xfer.len as
+			 * the actual read length.
+			 */
+			cmd->xfer->len = cmd->actual_len;
+		}
+
 		if (ret)
 			break;
 	}
-- 
2.34.1


             reply	other threads:[~2025-04-01  6:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  6:34 Stanley Chu [this message]
2025-04-01 15:00 ` Frank Li

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=20250401063406.3728534-1-yschu@nuvoton.com \
    --to=stanley.chuys@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=frank.li@nxp.com \
    --cc=kwliu@nuvoton.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=tomer.maimon@nuvoton.com \
    --cc=yschu@nuvoton.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®