Re: [PATCH v4 25/25] dmaengine: sdxi: Add DMA engine provider

From: Ravi Jonnalagadda

Date: Mon Nov 30 2026 - 13:46:58 EST


On Tue, 03 Nov 2026 20:50:06 -0600, Nathan Lynch wrote:
> [...] The wait is uninterruptible and bounded
> to ten seconds. On timeout, suppress remaining callbacks [...]

Hi Nathan,

Following my Tested-by on the cover [1], this is what a faulting copy
does to the provider on the same system. In short, one bad descriptor
costs more than the one copy:
1. The faulting channel stays dead, and releasing it takes 10 s.
2. Under load, a fault can stop the whole function, and every channel
then waits 10 s before it fails.
In both cases the error log sees the fault at once, but the dmaengine
channels do not act on it.

1. A faulting copy on one channel
---------------------------------
What I saw, with a 2 MiB copy to (or from) an unmapped IOVA:
- tx_status reports DMA_ERROR within 0.2 ms, but the callback never
runs.
- The channel stays dead: a valid copy issued after
dmaengine_terminate_sync() has still not completed 5 s later.
- Releasing the channel takes 10 s ("timed out waiting for DMA
channel 0 to drain"). A new channel works at once.
- With a half-mapped destination, nearly all of the mapped half is
written; with a bad source, nothing is.

Where it comes from:
- The context stops at the faulting descriptor, so the fenced
interrupt descriptor that ends the batch never runs, and nothing
completes the transactions behind the fault.
- Synchronize then polls for an idle channel until its ten seconds
are up. sashiko predicted this from the code on this patch
("context stop-on-error prevents IRQ reaping and stalls sync").
- The error log does see the fault. Wei's series [3] adds userspace
control on top of v4, and with its first 13 patches applied (09/44
handles the hardware error log), each fault logs a descriptor
buffer error about 0.1 ms after it. The channel still behaves as
above, since 13/44 kills only user contexts on fatal errors.

Question: could the provider complete the pending transactions with
DMA_TRANS_ABORTED once the context has stopped, from the error log
or from the context status, so that synchronize returns at once?

2. A fault that stops the whole function under load
---------------------------------------------------
What I saw, with four processes migrating THPs between DRAM and CXL
through dcbm from Shivank's offload series [2], 16 channels, and one
copy per run sent to an unmapped IOVA:
- Usually only the faulting context stops, as in 1.
- Sometimes the whole function goes to GSV_ERROR: the admin context
and all client contexts stop, while software has only rung
doorbells.
- After that no descriptor completes. Every synchronize waits 10 s,
every channel release WARNs and fails, and new channels fail to
start. Unbind and rebind of the function recovers it.
- With one copy in flight per channel, only the faulting context
stops.
- With Wei's 1-13 [3] applied, the error log reports the function error
within 2 ms of the fault, and 13/44 prints "function stopped after
hardware error". The DMA channels still wait out 10 s each.

Question: is a bad address in one descriptor expected to stop the
whole function? Either way, could the provider act on the function
failure that 13/44 detects, so that clients get an error at once
instead of after 10 s per channel?

Thanks,
Ravi

[1] https://lore.kernel.org/all/20261130182942.82006-1-ravis.opensrc@xxxxxxxxx/
[2] https://lore.kernel.org/all/20261128224616.66122-1-ravis.opensrc@xxxxxxxxx/
[3] https://lore.kernel.org/all/20261119202321.1734355-1-wei.huang2@xxxxxxx/