Hi Joshua,
joshua.yeong@xxxxxxxxxxxxxxxx wrote on Tue, 14 Nov 2023 11:34:30 +0800:
Some I3C hardware will report error when incorrect length is received froman
device. GETMXDS CCC are availble in 2 formats; without turnaround time (formatavailable :
1) and with turnaround time (format 2). There is no mechanics to determine whichSo in case?
format is supported by device. In case sending GETMXDS CCC format 2 resulted
failure, try sending GETMXDS CCC format 1 instead.in a
Signed-off-by: Joshua Yeong <joshua.yeong@xxxxxxxxxxxxxxxx>^
---
drivers/i3c/master.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 0cdc94e4cb77..2fc04d97f07e 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1099,8 +1099,16 @@ static int i3c_master_getmxds_locked(struct i3c_master_controller *master,
i3c_ccc_cmd_init(&cmd, true, I3C_CCC_GETMXDS, &dest, 1);
ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
- if (ret)
- goto out;
+ if (ret) {
+ /*
Wrong alignment of the starts below
v
+ * Retry when the device does not support max read turnaroundperiod?
+ * while expecting shorter length from this CCC command
+ */I believe this is a per-device configuration and we should save this in
+ dest->payload.len -= 3;
+ ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
+ if (ret)
+ goto out;
+ }
order to only fail once, no?
if (dest.payload.len != 2 && dest.payload.len != 5) {
ret = -EIO;
Thanks,
Miquèl