summaryrefslogtreecommitdiff
path: root/drivers/i3c
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@nxp.com>2024-10-02 10:50:35 -0400
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2024-10-31 23:53:39 +0100
commit6a12f56f7392cfdd2f31ef9a090ccadadae548e8 (patch)
treef4c87cdaf18beda1f5ad9edcd7339107ec27080b /drivers/i3c
parente22405a812a11e5b01bfbb18c5277dd3e69ba589 (diff)
i3c: master: svc: need check IBIWON for dynamic address assignment
When sending REQUEST_PROC_DAA, emit START and address 7E. Address arbitration may occur at this time if other devices trigger HJ, IBI, or CR events. When IBIWON happen during a REQUEST_PROC_DAA, NACK the IBI request then send a repeated start to continue current dynamic address assignment. Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20241002-svc-i3c-hj-v6-3-7e6e1d3569ae@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/i3c')
-rw-r--r--drivers/i3c/master/svc-i3c-master.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index c35a228f0c2f..5df0ec02d73c 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -872,6 +872,9 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master,
int ret, i;
while (true) {
+ /* clean SVC_I3C_MINT_IBIWON w1c bits */
+ writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS);
+
/* SVC_I3C_MCTRL_REQUEST_PROC_DAA have two mode, ENTER DAA or PROCESS DAA.
*
* ENTER DAA:
@@ -923,6 +926,9 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master,
ret = svc_i3c_master_readb(master, data, 2);
if (ret)
break;
+ } else if (SVC_I3C_MSTATUS_IBIWON(reg)) {
+ svc_i3c_master_handle_ibi_won(master, reg);
+ continue;
} else if (SVC_I3C_MSTATUS_MCTRLDONE(reg)) {
if (SVC_I3C_MSTATUS_STATE_IDLE(reg) &&
SVC_I3C_MSTATUS_COMPLETE(reg)) {