Skip to content

Commit 9aaeef1

Browse files
nxpfranklialexandrebelloni
authored andcommitted
i3c: master: svc: fix random hot join failure since timeout error
master side report: silvaco-i3c-master 44330000.i3c-master: Error condition: MSTATUS 0x020090c7, MERRWARN 0x00100000 BIT 20: TIMEOUT error The module has stalled too long in a frame. This happens when: - The TX FIFO or RX FIFO is not handled and the bus is stuck in the middle of a message, - No STOP was issued and between messages, - IBI manual is used and no decision was made. The maximum stall period is 100 μs. This can be considered as being just a warning as the system IRQ latency can easily be greater than 100us. Fixes: dd3c528 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: <[email protected]> Signed-off-by: Frank Li <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent dfd7cd6 commit 9aaeef1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/i3c/master/svc-i3c-master.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
#define SVC_I3C_MINTMASKED 0x098
9494
#define SVC_I3C_MERRWARN 0x09C
9595
#define SVC_I3C_MERRWARN_NACK BIT(2)
96+
#define SVC_I3C_MERRWARN_TIMEOUT BIT(20)
9697
#define SVC_I3C_MDMACTRL 0x0A0
9798
#define SVC_I3C_MDATACTRL 0x0AC
9899
#define SVC_I3C_MDATACTRL_FLUSHTB BIT(0)
@@ -227,6 +228,14 @@ static bool svc_i3c_master_error(struct svc_i3c_master *master)
227228
if (SVC_I3C_MSTATUS_ERRWARN(mstatus)) {
228229
merrwarn = readl(master->regs + SVC_I3C_MERRWARN);
229230
writel(merrwarn, master->regs + SVC_I3C_MERRWARN);
231+
232+
/* Ignore timeout error */
233+
if (merrwarn & SVC_I3C_MERRWARN_TIMEOUT) {
234+
dev_dbg(master->dev, "Warning condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n",
235+
mstatus, merrwarn);
236+
return false;
237+
}
238+
230239
dev_err(master->dev,
231240
"Error condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n",
232241
mstatus, merrwarn);

0 commit comments

Comments
 (0)