[PATCH 07/17] i3c: mipi-i3c-hci: Send DISEC before disabling IBIs in hardware

Frank Li Frank.li at oss.nxp.com
Mon Sep 14 09:29:36 PDT 2026


On Mon, Sep 14, 2026 at 02:29:53PM +0300, Adrian Hunter wrote:
> Reorder i3c_hci_disable_ibi() so that DISEC is sent before IBIs are
> disabled at the controller.
>
> This matches the sequence used by other I3C controller drivers.  It also
> avoids dropping an IBI that races with the disable operation: an IBI
> received after DISEC is issued but before the controller disables IBIs
> can still be processed normally.  Once DISEC has been sent, the hardware
> can be updated to NACK subsequent IBIs and complete the teardown.
>
> No functional change is intended beyond aligning the ordering with other
> drivers and handling the race window consistently.
>
> Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
> ---

Reviewed-by: Frank Li <Frank.Li at nxp.com>

>  drivers/i3c/master/mipi-i3c-hci/core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index 166d9f70f435..f6a34ce7a295 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -719,13 +719,14 @@ static int i3c_hci_disable_ibi(struct i3c_dev_desc *dev)
>  	struct i3c_master_controller *m = i3c_dev_get_master(dev);
>  	struct i3c_hci *hci = to_i3c_hci(m);
>
> -	__i3c_hci_disable_ibi(hci, dev);
>  	/*
> -	 * The DAT entry is now set to NACK and DISEC this target's IBIs, so
> +	 * The DAT entry will be 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);
> +
> +	__i3c_hci_disable_ibi(hci, dev);
>  	return 0;
>  }
>
> --
> 2.53.0
>



More information about the linux-i3c mailing list