From: Adrian Hunter <adrian.hunter@intel.com>
To: <alexandre.belloni@bootlin.com>
Cc: <Frank.Li@nxp.com>, <linux-i3c@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V3 00/16] i3c: mipi-i3c-hci: DMA abort, recovery and related improvements
Date: Tue, 12 May 2026 15:35:18 +0300 [thread overview]
Message-ID: <d803f8da-edaf-458f-a059-8df3ffe1316f@intel.com> (raw)
In-Reply-To: <20260504113352.38490-1-adrian.hunter@intel.com>
On 04/05/2026 14:33, Adrian Hunter wrote:
> Hi
>
> This series improves the robustness of the MIPI I3C HCI DMA mode driver,
> addressing issues observed during error handling and recovery.
Any comments on this?
>
> Patch 1 ensures suspend always invokes io->suspend.
>
> Patches 2-4 fix issues in the existing DMA abort path: preserving the RUN
> bit during abort per the MIPI specification, blocking enqueue during
> abort/error, and waiting for ring restart completion.
>
> Patches 5-8 improve how partially completed transfer lists are handled
> during dequeue: moving hci_dma_xfer_done() earlier so completed
> responses are processed before NoOp replacement, completing transfer
> lists immediately on error rather than deferring, and detecting when an
> abort races with transfer completion to avoid restarting the wrong
> transfer list.
>
> Patches 9-10 add Intel-specific quirks for DMA ring abort: a PIO queue
> reset after abort, and an HC_CONTROL ABORT before the ring-level abort.
>
> Patch 11 factors out a reset-and-restore helper from the suspend path
> for reuse.
>
> Patch 12 adds a full DMA recovery path for internal controller errors.
> When the hardware reports a TID mismatch or the ring becomes stuck, the
> driver now resets and restores the controller, terminating all in-flight
> transfers with an error status.
>
> Patch 13 makes NoOp command handling observable: instead of discarding
> NoOp responses, the driver now waits for them to complete and triggers
> recovery if they fail.
>
> Patch 14 adjusts transfer timeout accounting to start from when a
> transfer actually begins execution rather than when it was queued,
> preventing premature timeouts behind slow predecessors.
>
> Patches 15-16 are minor optimizations: consolidating the DMA command and
> response ring into a single coherent allocation, and increasing the ring
> size to the maximum 255 entries to avoid ring-space exhaustion.
>
>
> Changes in V3:
>
> i3c: mipi-i3c-hci: Fix suspend behavior when bus disable falls back to software reset
> i3c: mipi-i3c-hci: Preserve RUN bit when aborting DMA ring
> Add Frank's rev'd-by
>
> i3c: mipi-i3c-hci: Add DMA-mode recovery for internal controller errors
> When erroring out transfers, ensure the final transfer of a
> transfer list is processed last
>
>
> Changes in V2:
>
> i3c: mipi-i3c-hci: Fix suspend behavior when bus disable falls back to software reset
> Always return 0 from suspend callback
> Amend commit message
>
> i3c: mipi-i3c-hci: Preserve RUN bit when aborting DMA ring
> Improve commit message
>
> i3c: mipi-i3c-hci: Prevent DMA enqueue while ring is aborting or in error
> Improve commit message
>
> i3c: mipi-i3c-hci: Wait for DMA ring restart to complete
> None
>
> i3c: mipi-i3c-hci: Move hci_dma_xfer_done() definition
> Add Frank's Rev'd-by
>
> i3c: mipi-i3c-hci: Call hci_dma_xfer_done() from dequeue path
> Add Frank's Rev'd-by
>
> i3c: mipi-i3c-hci: Complete transfer lists immediately on error
> Rename completing_xfer to final_xfer
>
> i3c: mipi-i3c-hci: Avoid restarting DMA ring after aborting wrong transfer
> Rename completing_xfer to final_xfer
>
> i3c: mipi-i3c-hci: Add DMA ring abort/reset quirk for Intel controllers
> None
>
> i3c: mipi-i3c-hci: Add DMA ring abort quirk for Intel controllers
> None
>
> i3c: mipi-i3c-hci: Factor out reset-and-restore helper
> Drop redundant i3c_hci_sync_irq_inactive(hci)
> from i3c_hci_reset_and_restore() because it is called by
> hci->io->suspend() anyway
>
> i3c: mipi-i3c-hci: Add DMA-mode recovery for internal controller errors
> Rename completing_xfer to final_xfer
> Add hci_dma_xfer_done() before checking for an already complete
> transfer
> Improve commit message
>
> i3c: mipi-i3c-hci: Wait for NoOp commands to complete
> Rename completing_xfer to final_xfer
> Add missing reinit_completion()
>
> i3c: mipi-i3c-hci: Base timeouts on actual transfer start time
> Do not flag the next transfer as started when there is an error
> which halts the controller
> Instead flag it started at the end of hci_dma_dequeue_xfer()
> Use hci_start_xfer() in pio.c
>
> i3c: mipi-i3c-hci: Consolidate DMA ring allocation
> Check for failed allocation before assignments to avoid doing
> arithmetic with NULL pointers
>
> i3c: mipi-i3c-hci: Increase DMA transfer ring size to maximum
> None
>
>
> Adrian Hunter (16):
> i3c: mipi-i3c-hci: Fix suspend behavior when bus disable falls back to software reset
> i3c: mipi-i3c-hci: Preserve RUN bit when aborting DMA ring
> i3c: mipi-i3c-hci: Prevent DMA enqueue while ring is aborting or in error
> i3c: mipi-i3c-hci: Wait for DMA ring restart to complete
> i3c: mipi-i3c-hci: Move hci_dma_xfer_done() definition
> i3c: mipi-i3c-hci: Call hci_dma_xfer_done() from dequeue path
> i3c: mipi-i3c-hci: Complete transfer lists immediately on error
> i3c: mipi-i3c-hci: Avoid restarting DMA ring after aborting wrong transfer
> i3c: mipi-i3c-hci: Add DMA ring abort/reset quirk for Intel controllers
> i3c: mipi-i3c-hci: Add DMA ring abort quirk for Intel controllers
> i3c: mipi-i3c-hci: Factor out reset-and-restore helper
> i3c: mipi-i3c-hci: Add DMA-mode recovery for internal controller errors
> i3c: mipi-i3c-hci: Wait for NoOp commands to complete
> i3c: mipi-i3c-hci: Base timeouts on actual transfer start time
> i3c: mipi-i3c-hci: Consolidate DMA ring allocation
> i3c: mipi-i3c-hci: Increase DMA transfer ring size to maximum
>
> drivers/i3c/master/mipi-i3c-hci/cmd.h | 6 +
> drivers/i3c/master/mipi-i3c-hci/core.c | 82 ++++++--
> drivers/i3c/master/mipi-i3c-hci/dma.c | 344 +++++++++++++++++++++++++--------
> drivers/i3c/master/mipi-i3c-hci/hci.h | 22 +++
> drivers/i3c/master/mipi-i3c-hci/pio.c | 1 +
> 5 files changed, 365 insertions(+), 90 deletions(-)
>
>
> Regards
> Adrian
next parent reply other threads:[~2026-05-12 12:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260504113352.38490-1-adrian.hunter@intel.com>
2026-05-12 12:35 ` Adrian Hunter [this message]
[not found] ` <20260504113352.38490-4-adrian.hunter@intel.com>
2026-05-12 16:44 ` [PATCH V3 03/16] i3c: mipi-i3c-hci: Prevent DMA enqueue while ring is aborting or in error Frank Li
[not found] ` <20260504113352.38490-5-adrian.hunter@intel.com>
2026-05-12 16:45 ` [PATCH V3 04/16] i3c: mipi-i3c-hci: Wait for DMA ring restart to complete Frank Li
[not found] ` <20260504113352.38490-8-adrian.hunter@intel.com>
2026-05-12 16:46 ` [PATCH V3 07/16] i3c: mipi-i3c-hci: Complete transfer lists immediately on error Frank Li
[not found] ` <20260504113352.38490-9-adrian.hunter@intel.com>
2026-05-12 16:50 ` [PATCH V3 08/16] i3c: mipi-i3c-hci: Avoid restarting DMA ring after aborting wrong transfer Frank Li
[not found] ` <20260504113352.38490-10-adrian.hunter@intel.com>
2026-05-12 16:53 ` [PATCH V3 09/16] i3c: mipi-i3c-hci: Add DMA ring abort/reset quirk for Intel controllers Frank Li
[not found] ` <20260504113352.38490-11-adrian.hunter@intel.com>
2026-05-12 17:01 ` [PATCH V3 10/16] i3c: mipi-i3c-hci: Add DMA ring abort " Frank Li
[not found] ` <20260504113352.38490-12-adrian.hunter@intel.com>
2026-05-12 17:03 ` [PATCH V3 11/16] i3c: mipi-i3c-hci: Factor out reset-and-restore helper Frank Li
[not found] ` <20260504113352.38490-14-adrian.hunter@intel.com>
2026-05-12 18:05 ` [PATCH V3 13/16] i3c: mipi-i3c-hci: Wait for NoOp commands to complete Frank Li
[not found] ` <20260504113352.38490-15-adrian.hunter@intel.com>
2026-05-12 18:11 ` [PATCH V3 14/16] i3c: mipi-i3c-hci: Base timeouts on actual transfer start time Frank Li
[not found] ` <20260504113352.38490-16-adrian.hunter@intel.com>
2026-05-12 18:15 ` [PATCH V3 15/16] i3c: mipi-i3c-hci: Consolidate DMA ring allocation Frank Li
[not found] ` <20260504113352.38490-17-adrian.hunter@intel.com>
2026-05-12 18:15 ` [PATCH V3 16/16] i3c: mipi-i3c-hci: Increase DMA transfer ring size to maximum Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d803f8da-edaf-458f-a059-8df3ffe1316f@intel.com \
--to=adrian.hunter@intel.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox