From: Meagan Lloyd <meaganlloyd@linux.microsoft.com>
To: linux-i3c@lists.infradead.org
Cc: meaganlloyd@linux.microsoft.com, alexandre.belloni@bootlin.com,
vitor.soares@toradex.com, samagazaryan@google.com,
gregkh@linuxfoundation.org, arnd@arndb.de,
boris.brezillon@collabora.com,
oleksandr.shulzhenko.viktorovych@intel.com,
tgopinath@linux.microsoft.com, corbet@lwn.net,
skhan@linuxfoundation.org, linux@roeck-us.net, Frank.Li@nxp.com,
jorge.marques@analog.com, pgaj@cadence.com,
wsa+renesas@sang-engineering.com,
tommaso.merciai.xr@bp.renesas.com, nuno.sa@analog.com,
Michael.Hennerich@analog.com, jic23@kernel.org,
dlechner@baylibre.com, andy@kernel.org, lorenzo@kernel.org,
enelsonmoore@gmail.com, rppt@kernel.org, pratyush@kernel.org,
giovanni.cabiddu@intel.com, gabewhigham@gmail.com,
haren@linux.ibm.com, pasha.tatashin@soleen.com,
jirislaby@kernel.org, adrian.ho.yin.ng@altera.com,
ustc.gu@gmail.com, jszhang@kernel.org, adrian.hunter@intel.com,
akhilrajeev@nvidia.com, tze.yee.ng@altera.com,
manikanta.guntupalli@amd.com, shubhrajyoti.datta@amd.com,
jarkko.nikula@linux.intel.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux@analog.com, linux-iio@vger.kernel.org
Subject: [PATCH 2/3] i3c: set i3c_xfer.actual_len in controller drivers
Date: Fri, 11 Sep 2026 14:09:34 -0700 [thread overview]
Message-ID: <20260911210935.1353126-3-meaganlloyd@linux.microsoft.com> (raw)
In-Reply-To: <20260911210935.1353126-1-meaganlloyd@linux.microsoft.com>
Set i3c_xfer.actual_len for reads across the I3C Controller drivers.
actual_len provides a consistent location for device drivers to know the
read response bytes without overriding the len field.
Signed-off-by: Meagan Lloyd <meaganlloyd@linux.microsoft.com>
---
drivers/i3c/master/adi-i3c-master.c | 5 ++++-
drivers/i3c/master/dw-i3c-master.c | 4 +++-
drivers/i3c/master/i3c-master-cdns.c | 5 ++++-
drivers/i3c/master/mipi-i3c-hci/core.c | 5 ++++-
drivers/i3c/master/renesas-i3c.c | 3 +++
5 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c
index b35386260350..d033bfd4ecc2 100644
--- a/drivers/i3c/master/adi-i3c-master.c
+++ b/drivers/i3c/master/adi-i3c-master.c
@@ -412,8 +412,11 @@ static int adi_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,
ret = xfer->ret;
- for (i = 0; i < nxfers; i++)
+ for (i = 0; i < nxfers; i++) {
xfers[i].err = adi_i3c_cmd_get_err(&xfer->cmds[i]);
+ if (xfers[i].rnw)
+ xfers[i].actual_len = xfer->cmds[i].rx_len;
+ }
return ret;
}
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 4563d8761ba0..54406e31c870 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1028,8 +1028,10 @@ static int dw_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,
for (i = 0; i < i3c_nxfers; i++) {
struct dw_i3c_cmd *cmd = &xfer->cmds[i];
- if (i3c_xfers[i].rnw)
+ if (i3c_xfers[i].rnw) {
i3c_xfers[i].len = cmd->rx_len;
+ i3c_xfers[i].actual_len = cmd->rx_len;
+ }
}
ret = xfer->ret;
diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
index 2d98c1ce9b12..331062c10b31 100644
--- a/drivers/i3c/master/i3c-master-cdns.c
+++ b/drivers/i3c/master/i3c-master-cdns.c
@@ -795,8 +795,11 @@ static int cdns_i3c_master_i3c_xfers(struct i3c_dev_desc *dev,
ret = cdns_xfer->ret;
- for (i = 0; i < nxfers; i++)
+ for (i = 0; i < nxfers; i++) {
xfers[i].err = cdns_i3c_cmd_get_err(&cdns_xfer->cmds[i]);
+ if (xfers[i].rnw)
+ xfers[i].actual_len = cdns_xfer->cmds[i].rx_len;
+ }
cdns_i3c_master_free_xfer(cdns_xfer);
diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index dadf049bd4b5..29fa68e29484 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -508,8 +508,11 @@ static int i3c_hci_i3c_xfers(struct i3c_dev_desc *dev,
if (ret)
goto out;
for (i = 0; i < nxfers; i++) {
- if (i3c_xfers[i].rnw)
+ if (i3c_xfers[i].rnw) {
i3c_xfers[i].len = RESP_DATA_LENGTH(xfer[i].response);
+ i3c_xfers[i].actual_len = RESP_DATA_LENGTH(xfer[i].response);
+ }
+
if (RESP_STATUS(xfer[i].response) != RESP_SUCCESS) {
ret = -EIO;
goto out;
diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 28c0927a0179..a3dcb4cd9b0e 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -918,6 +918,9 @@ static int renesas_i3c_i3c_xfers(struct i3c_dev_desc *dev, struct i3c_xfer *i3c_
time_left = renesas_i3c_wait_xfer(i3c, xfer);
if (!time_left)
xfer_failed = true;
+
+ if (i3c_xfers[i].rnw)
+ i3c_xfers[i].actual_len = cmd->rx_count;
}
if (xfer_failed)
--
2.49.0
next prev parent reply other threads:[~2026-09-11 21:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 21:09 [PATCH 0/3] I3C character device driver using driver_override Meagan Lloyd
2026-09-11 21:09 ` [PATCH 1/3] i3c: master: enable driver_override for I3C Meagan Lloyd
2026-09-11 21:36 ` Guenter Roeck
2026-09-12 13:22 ` Andy Shevchenko
2026-09-13 0:24 ` Jonathan Cameron
2026-09-11 21:09 ` Meagan Lloyd [this message]
2026-09-13 0:26 ` [PATCH 2/3] i3c: set i3c_xfer.actual_len in controller drivers Jonathan Cameron
2026-09-11 21:09 ` [PATCH 3/3] i3c: add i3cdev character device module for user-space access Meagan Lloyd
2026-09-11 23:29 ` Randy Dunlap
2026-09-12 13:34 ` Andy Shevchenko
2026-09-12 13:26 ` [PATCH 0/3] I3C character device driver using driver_override Andy Shevchenko
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=20260911210935.1353126-3-meaganlloyd@linux.microsoft.com \
--to=meaganlloyd@linux.microsoft.com \
--cc=Frank.Li@nxp.com \
--cc=Michael.Hennerich@analog.com \
--cc=adrian.ho.yin.ng@altera.com \
--cc=adrian.hunter@intel.com \
--cc=akhilrajeev@nvidia.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=boris.brezillon@collabora.com \
--cc=corbet@lwn.net \
--cc=dlechner@baylibre.com \
--cc=enelsonmoore@gmail.com \
--cc=gabewhigham@gmail.com \
--cc=giovanni.cabiddu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=haren@linux.ibm.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jic23@kernel.org \
--cc=jirislaby@kernel.org \
--cc=jorge.marques@analog.com \
--cc=jszhang@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=linux@roeck-us.net \
--cc=lorenzo@kernel.org \
--cc=manikanta.guntupalli@amd.com \
--cc=nuno.sa@analog.com \
--cc=oleksandr.shulzhenko.viktorovych@intel.com \
--cc=pasha.tatashin@soleen.com \
--cc=pgaj@cadence.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=samagazaryan@google.com \
--cc=shubhrajyoti.datta@amd.com \
--cc=skhan@linuxfoundation.org \
--cc=tgopinath@linux.microsoft.com \
--cc=tommaso.merciai.xr@bp.renesas.com \
--cc=tze.yee.ng@altera.com \
--cc=ustc.gu@gmail.com \
--cc=vitor.soares@toradex.com \
--cc=wsa+renesas@sang-engineering.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;
as well as URLs for NNTP newsgroup(s).