* [PATCH v3 0/1] Fallback mechanism for GETMXDS CCC
@ 2023-11-14 8:55 Joshua Yeong
2023-11-14 8:55 ` [PATCH v3 1/1] i3c: Add fallback method " Joshua Yeong
2023-11-16 22:40 ` [PATCH v3 0/1] Fallback mechanism " Alexandre Belloni
0 siblings, 2 replies; 4+ messages in thread
From: Joshua Yeong @ 2023-11-14 8:55 UTC (permalink / raw)
To: alexandre.belloni, miquel.raynal; +Cc: linux-i3c, linux-kernel, Joshua Yeong
Some I3C hardware does not support turnaround time in GETMXDS. Cadence IPs will
perform validation against length of CCC returned. Similar hardware error were
not seen in other IPs DW/SVC.
Joshua Yeong (1):
i3c: Add fallback method for GETMXDS CCC
drivers/i3c/master.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
2.25.1
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/1] i3c: Add fallback method for GETMXDS CCC
2023-11-14 8:55 [PATCH v3 0/1] Fallback mechanism for GETMXDS CCC Joshua Yeong
@ 2023-11-14 8:55 ` Joshua Yeong
2023-11-14 8:57 ` Miquel Raynal
2023-11-16 22:40 ` [PATCH v3 0/1] Fallback mechanism " Alexandre Belloni
1 sibling, 1 reply; 4+ messages in thread
From: Joshua Yeong @ 2023-11-14 8:55 UTC (permalink / raw)
To: alexandre.belloni, miquel.raynal; +Cc: linux-i3c, linux-kernel, Joshua Yeong
Some I3C hardware will report error when an incorrect length is received from
device. GETMXDS CCC are available in 2 formats: without turnaround time (format
1) and with turnaround time (format 2). There is no mechanics to determine which
format is supported by device. So in case sending GETMXDS CCC format 2 resulted
in a failure, try sending GETMXDS CCC format 1 instead.
Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.com>
---
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 95caa162706f..718b643cb54d 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1130,8 +1130,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) {
+ /*
+ * Retry when the device does not support max read turnaround
+ * while expecting shorter length from this CCC command.
+ */
+ dest->payload.len -= 3;
+ ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
+ if (ret)
+ goto out;
+ }
if (dest.payload.len != 2 && dest.payload.len != 5) {
ret = -EIO;
--
2.25.1
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v3 1/1] i3c: Add fallback method for GETMXDS CCC
2023-11-14 8:55 ` [PATCH v3 1/1] i3c: Add fallback method " Joshua Yeong
@ 2023-11-14 8:57 ` Miquel Raynal
0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2023-11-14 8:57 UTC (permalink / raw)
To: Joshua Yeong; +Cc: alexandre.belloni, linux-i3c, linux-kernel
Hi Joshua,
joshua.yeong@starfivetech.com wrote on Tue, 14 Nov 2023 16:55:25 +0800:
> Some I3C hardware will report error when an incorrect length is received from
> device. GETMXDS CCC are available in 2 formats: without turnaround time (format
> 1) and with turnaround time (format 2). There is no mechanics to determine which
> format is supported by device. So in case sending GETMXDS CCC format 2 resulted
> in a failure, try sending GETMXDS CCC format 1 instead.
>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Joshua Yeong <joshua.yeong@starfivetech.com>
> ---
Thanks,
Miquèl
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 0/1] Fallback mechanism for GETMXDS CCC
2023-11-14 8:55 [PATCH v3 0/1] Fallback mechanism for GETMXDS CCC Joshua Yeong
2023-11-14 8:55 ` [PATCH v3 1/1] i3c: Add fallback method " Joshua Yeong
@ 2023-11-16 22:40 ` Alexandre Belloni
1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2023-11-16 22:40 UTC (permalink / raw)
To: miquel.raynal, Joshua Yeong; +Cc: linux-i3c, linux-kernel
On Tue, 14 Nov 2023 16:55:24 +0800, Joshua Yeong wrote:
> Some I3C hardware does not support turnaround time in GETMXDS. Cadence IPs will
> perform validation against length of CCC returned. Similar hardware error were
> not seen in other IPs DW/SVC.
>
> Joshua Yeong (1):
> i3c: Add fallback method for GETMXDS CCC
>
> [...]
Applied, thanks!
[1/1] i3c: Add fallback method for GETMXDS CCC
commit: 2aac0bf4ebc8e09941bb2a40c0ce725437d9a82c
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-16 22:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-14 8:55 [PATCH v3 0/1] Fallback mechanism for GETMXDS CCC Joshua Yeong
2023-11-14 8:55 ` [PATCH v3 1/1] i3c: Add fallback method " Joshua Yeong
2023-11-14 8:57 ` Miquel Raynal
2023-11-16 22:40 ` [PATCH v3 0/1] Fallback mechanism " Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox