i3c: master: svc: Update actual read length
Subsystems (2)
PATCH 1/1 i3c: master: svc: Update actual read length
From: Stanley Chu <[email protected]>
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.
--- drivers/i3c/master/svc-i3c-master.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/i3c/master/svc-i3c-master.c +8 -1
@@ -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 ; }
Signature · 1 line
2.34.1
Frank Li
maintainerQuoted 3 lines · Stanley Chu
From: Stanley Chu <[email protected]>
Some drivers, such as
mctp-i3c.c, reuse the i3c_priv_xfer.len as
In include/linux/i3c/device.h define API as
/**
* struct i3c_priv_xfer - I3C SDR private transfer
...
* @len: transfer length in bytes of the transfer
* @actual_len: actual length in bytes are transferred by the controller
...
*/
struct i3c_priv_xfer {
...
u16 len;
u16 actual_len;...
};
You should fix mctp-i3c.c or need change API defination firstly.
Frank
Quoted 33 lines
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 <[email protected]>--- drivers/i3c/master/svc-i3c-master.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/i3c/master/svc-i3c-master.c +8
-2@@ -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