]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: mipi-i3c-hci: Reset RING_OPERATION1 fields during init
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 13 Jan 2026 07:26:42 +0000 (09:26 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 14 Jan 2026 16:21:09 +0000 (17:21 +0100)
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>
Link: https://patch.msgid.link/20260113072702.16268-2-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/mipi-i3c-hci/dma.c

index 0f6bbe184e8541f74db7c947744328386b025ddc..5515ed740ca4b56ddbcf0f59b21fe33ebaf18308 100644 (file)
@@ -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);
        }