Skip to content

Commit 67df5ce

Browse files
mkjalexandrebelloni
authored andcommitted
i3c: dw: Return the length from a read priv_xfer
We currently assume that the rx_len of a read command will be as submitted, but we may have a shorter read than expected. This change populates the output i3c xfer length from the actually-read length. Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://lore.kernel.org/r/f4fff7ab18dee1f662dc7a5a4111fcd921e6792b.1680156630.git.jk@codeconstruct.com.au Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 2810f1d commit 67df5ce

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/i3c/master/dw-i3c-master.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,13 @@ static int dw_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
887887
if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT))
888888
dw_i3c_master_dequeue_xfer(master, xfer);
889889

890+
for (i = 0; i < i3c_nxfers; i++) {
891+
struct dw_i3c_cmd *cmd = &xfer->cmds[i];
892+
893+
if (i3c_xfers[i].rnw)
894+
i3c_xfers[i].len = cmd->rx_len;
895+
}
896+
890897
ret = xfer->ret;
891898
dw_i3c_master_free_xfer(xfer);
892899

0 commit comments

Comments
 (0)