* dmaengine: pl330: no device_synchronize -- does terminate_sync guarantee the transfer stopped?
@ 2026-10-31 0:58 Samarth Narang
0 siblings, 0 replies; only message in thread
From: Samarth Narang @ 2026-10-31 0:58 UTC (permalink / raw)
To: Vinod Koul
Cc: Samarth Narang, Frank Li, Marek Szyprowski, dmaengine,
linux-kernel
Hello,
I'm trying to clarify the termination guarantees provided by the PL330
DMAengine driver.
PL330 does not implement device_synchronize. Consequently, for PL330
channels, dmaengine_terminate_sync() calls pl330_terminate_all() without
any additional provider-specific synchronization.
pl330_terminate_all() requests termination through _stop(), which issues
DMAKILL using the controller's debug interface. However, I could not
establish from the driver code that this operation waits for the channel
thread to reach STOPPED or guarantees that all outstanding bus writes
have completed before returning.
There is a separate callback concern: PL330 uses a per-channel
completion tasklet, but pl330_terminate_all() does not explicitly
synchronize or kill that tasklet. The tasklet is killed in
pl330_free_chan_resources().
DMAengine clients rely on dmaengine_terminate_sync(), or
dmaengine_terminate_async() followed by dmaengine_synchronize(), to
establish that the DMA operation and its callbacks have completed before
unmapping or freeing buffers, as described in
Documentation/driver-api/dmaengine/client.rst.
One relevant client is Samsung UART on Exynos. Its release_dma() path
has a proposed change to use dmaengine_terminate_sync() before unmapping
and freeing the RX buffer [1]. The safety of that ordering depends on
the guarantees provided by PL330.
I have two questions:
Hardware completion: Does DMAKILL guarantee that all outstanding DMA bus
transactions have completed before the command finishes, or is an
additional wait for the channel to reach STOPPED required?
Callback synchronization: Can a PL330 completion tasklet still be
running or become scheduled after pl330_terminate_all() returns? If so,
would implementing device_synchronize to wait for the appropriate
hardware retirement condition and synchronize the tasklet be the
preferred approach?
I'm particularly interested in whether PL330 currently satisfies the
DMAengine synchronous-termination contract, or whether an additional
synchronization mechanism is needed.
This question arose from a research static analyzer for DMA lifecycle
ordering and a subsequent source review.
[1] https://lore.kernel.org/r/20261030162334.3000737-1-samarth.colleges@gmail.com
Thanks,
Samarth
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-31 0:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-31 0:58 dmaengine: pl330: no device_synchronize -- does terminate_sync guarantee the transfer stopped? Samarth Narang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox