diff mbox series

[7/7] i3c: master: svc: manually emit NACK/ACK for hotjoin

Message ID 20240724-i3c_fix-v1-7-bfa500b023d6@nxp.com (mailing list archive)
State Superseded
Headers show
Series i3c: master: some fix and improvemnt for hotjoin | expand

Commit Message

Frank Li July 24, 2024, 3:45 p.m. UTC
When the address is arbitrated at send address, the hardware can auto-send
NACK if it is an IBI. However, manual emission of NACK/ACK is needed for
hot join or controller request events.

Add an event type check to send out NACK if the event is not an IBI.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/i3c/master/svc-i3c-master.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 5d19251238ff8..36e01d0430747 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -1113,7 +1113,15 @@  static int svc_i3c_master_xfer(struct svc_i3c_master *master,
 		 * start.
 		 */
 		if (SVC_I3C_MSTATUS_IBIWON(reg)) {
+			int ibitype = SVC_I3C_MSTATUS_IBITYPE(reg);
+
 			writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS);
+
+			/* Hardware can't auto emit NACK for hot join and master request */
+			if (ibitype == SVC_I3C_MSTATUS_IBITYPE_HOT_JOIN ||
+			    ibitype == SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST)
+				svc_i3c_master_nack_ibi(master);
+
 			continue;
 		}