Re: [PATCH 01/17] i3c: mipi-i3c-hci: Reset RING_OPERATION1 fields during init

Frank Li
2025-12-19T16:12:55Z

On Fri, Dec 19, 2025 at 04:45:18PM +0200, Adrian Hunter wrote:
> The MIPI I3C HCI specification does not define reset values for
> RING_OPERATION1 fields, and some controllers (e.g., Intel) do not clear
> them during a software reset. Ensure the ring pointers are explicitly
> set to zero during bus initialization to avoid inconsistent state.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---

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

> drivers/i3c/master/mipi-i3c-hci/dma.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c
> index 0f6bbe184e85..5515ed740ca4 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/dma.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c
> @@ -340,6 +340,14 @@ static int hci_dma_init(struct i3c_hci *hci)
> rh_reg_write(INTR_SIGNAL_ENABLE, regval);
>
> ring_ready:
> + /*
> + * The MIPI I3C HCI specification does not document reset values for
> + * RING_OPERATION1 fields and some controllers (e.g. Intel controllers)
> + * do not reset the values, so ensure the ring pointers are set to zero
> + * here.
> + */
> + rh_reg_write(RING_OPERATION1, 0);
> +
> rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE |
> RING_CTRL_RUN_STOP);
> }
> --
> 2.51.0
>
>
> --
> linux-i3c mailing list
> linux-i3c@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-i3c