public inbox for linux-i3c@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling
@ 2024-01-19  5:45 Dylan Hung
  2024-02-18 23:32 ` Alexandre Belloni
  2024-05-01  6:22 ` Jeremy Kerr
  0 siblings, 2 replies; 7+ messages in thread
From: Dylan Hung @ 2024-01-19  5:45 UTC (permalink / raw)
  To: alexandre.belloni, jk, joel, u.kleine-koenig, gustavoars,
	krzysztof.kozlowski, zenghuchen, matt, linux-i3c, linux-kernel
  Cc: BMC-SW

Disable IBI IRQ signal and status only when hot-join and SIR enabling of
all target devices attached to the bus are disabled.

Fixes: e389b1d72a62 ("i3c: dw: Add support for in-band interrupts")

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
---
 drivers/i3c/master/dw-i3c-master.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index ef5751e91cc9..276153e10f5a 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1163,8 +1163,10 @@ static void dw_i3c_master_set_sir_enabled(struct dw_i3c_master *master,
 		global = reg == 0xffffffff;
 		reg &= ~BIT(idx);
 	} else {
-		global = reg == 0;
+		bool hj_rejected = !!(readl(master->regs + DEVICE_CTRL) & DEV_CTRL_HOT_JOIN_NACK);
+
 		reg |= BIT(idx);
+		global = (reg == 0xffffffff) && hj_rejected;
 	}
 	writel(reg, master->regs + IBI_SIR_REQ_REJECT);
 
-- 
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] 7+ messages in thread

end of thread, other threads:[~2024-05-06  6:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-19  5:45 [PATCH] i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling Dylan Hung
2024-02-18 23:32 ` Alexandre Belloni
2024-05-01  6:22 ` Jeremy Kerr
2024-05-02  5:24   ` Dylan Hung
2024-05-06  5:09     ` Jeremy Kerr
2024-05-06  5:48       ` Dylan Hung
2024-05-06  6:58         ` Jeremy Kerr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox