linux/drivers/i3c
Adrian Hunter 003df94bcc i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue
commit b795e68bf3 upstream.

The logic used to abort the DMA ring contains several flaws:

 1. The driver unconditionally issues a ring abort even when the ring has
    already stopped.
 2. The completion used to wait for abort completion is never
    re-initialized, resulting in incorrect wait behavior.
 3. The abort sequence unintentionally clears RING_CTRL_ENABLE, which
    resets hardware ring pointers and disrupts the controller state.
 4. If the ring is already stopped, the abort operation should be
    considered successful without attempting further action.

Fix the abort handling by checking whether the ring is running before
issuing an abort, re-initializing the completion when needed, ensuring that
RING_CTRL_ENABLE remains asserted during abort, and treating an already
stopped ring as a successful condition.

Fixes: 9ad9a52cce ("i3c/master: introduce the mipi-i3c-hci driver")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260306072451.11131-9-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-03-19 16:08:48 +01:00
..
master i3c: mipi-i3c-hci: Correct RING_CTRL_ABORT handling in DMA dequeue 2026-03-19 16:08:48 +01:00
device.c i3c: Fix i3c_device_do_priv_xfers() kernel-doc indentation 2025-07-31 01:23:12 +02:00
internals.h i3c: fix big-endian FIFO transfers 2025-09-29 00:17:22 +02:00
Kconfig i3c: Add core I3C infrastructure 2018-11-12 10:33:49 +01:00
Makefile i3c: Add core I3C infrastructure 2018-11-12 10:33:49 +01:00
master.c i3c: master: Update hot-join flag only on success 2026-02-26 14:58:57 -08:00