[PATCH 2/7] i3c: mipi-i3c-hci: Ignore DISEC failures when disabling IBIs
From: Adrian Hunter
Date: Wed May 27 2026 - 07:29:33 EST
Disabling IBIs currently returns the result of the DISEC CCC, causing
i3c_hci_disable_ibi() to fail if the transfer errors out.
However, the controller has already been programmed to reject IBIs by
setting DAT_0_SIR_REJECT, so the target’s IBIs are effectively disabled
from the host side regardless of the outcome of the DISEC command. At
this point, teardown of the IBI infrastructure can safely proceed even
if DISEC fails.
Note, from then on, the MIPI I3C HCI not only NACKs the target's IBI but
automatically sends another DISEC command.
Make i3c_hci_disable_ibi() resilient by ignoring the return value of
i3c_master_disec_locked() and always returning success.
Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
drivers/i3c/master/mipi-i3c-hci/core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index b19bdff5c5e2..3ef7faed9957 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -689,7 +689,13 @@ static int i3c_hci_disable_ibi(struct i3c_dev_desc *dev)
mipi_i3c_hci_dat_v1.set_flags(hci, dev_data->dat_idx, DAT_0_SIR_REJECT, 0);
scoped_guard(spinlock_irqsave, &hci->lock)
hci->ibi_devs[dev_data->dat_idx] = NULL;
- return i3c_master_disec_locked(m, dev->info.dyn_addr, I3C_CCC_EVENT_SIR);
+ /*
+ * The DAT entry is now set to NACK and DISEC this target's IBIs, so
+ * the IBI teardown can proceed even if DISEC below fails, so ignore
+ * errors.
+ */
+ i3c_master_disec_locked(m, dev->info.dyn_addr, I3C_CCC_EVENT_SIR);
+ return 0;
}
static void i3c_hci_recycle_ibi_slot(struct i3c_dev_desc *dev,
--
2.51.0