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

Frank Li Frank.Li at nxp.com
Wed Jul 24 08:45:52 PDT 2024


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 at nxp.com>
---
 drivers/i3c/master/svc-i3c-master.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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;
 		}
 

-- 
2.34.1




More information about the linux-i3c mailing list