DMA Engine development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] dmaengine: dw-axi-dmac: clean up DMAC enable and PM
@ 2026-05-25  7:10 tze.yee.ng
  2026-05-25  7:10 ` [PATCH v2 1/2] dmaengine: dw-axi-dmac: drop redundant DMAC enable in block start tze.yee.ng
  2026-05-25  7:10 ` [PATCH v2 2/2] dmaengine: dw-axi-dmac: fix PM for system sleep and channel alloc tze.yee.ng
  0 siblings, 2 replies; 5+ messages in thread
From: tze.yee.ng @ 2026-05-25  7:10 UTC (permalink / raw)
  To: Eugeniy Paltsev, Vinod Koul, Frank Li, dmaengine, linux-kernel
  Cc: Tze Yee Ng, Adrian Ng Ho Yin, Nazim Amirul

From: Tze Yee Ng <tze.yee.ng@altera.com>

The DesignWare AXI DMAC driver enables the controller in axi_dma_resume(),
which is invoked from the runtime PM resume path and from probe. Calling
axi_dma_enable() again at the start of every block transfer is redundant
on the normal path.

That extra call had also masked a gap in system-sleep power management:
with only runtime PM callbacks registered, a channel could remain allocated
across suspend/resume while the runtime usage count stayed non-zero and
axi_dma_runtime_resume() was not run, leaving DMAC_CFG and clocks out of
sync with software state. Removing the per-transfer enable without fixing
PM would make that scenario more visible.

This series drops the redundant enable and adds the missing system-sleep
and channel-allocation PM handling called out during review.

Patch 1 removes axi_dma_enable() from axi_chan_block_xfer_start().

Patch 2 (follow-up to review feedback from Sashiko Watanabe):

 - Add SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
   pm_runtime_force_resume) so system suspend/resume reuses the existing
   axi_dma_suspend() and axi_dma_resume() paths even when the runtime
   usage count is non-zero.

 - Replace pm_runtime_get() with pm_runtime_resume_and_get() in
   dma_chan_alloc_chan_resources(), with pm_runtime_put() on error paths,
   so clocks are enabled before a client can submit a transfer immediately
   after allocation.

Changes in v2:
- Add Patch 2 as a follow-up to review feedback from Sashiko Watanabe.
- No changes to Patch 1.

Niravkumar L Rabara (1):
  dmaengine: dw-axi-dmac: drop redundant DMAC enable in block start

Tze Yee Ng (1):
  dmaengine: dw-axi-dmac: fix PM for system sleep and channel alloc

 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

-- 
2.43.7


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-25  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25  7:10 [PATCH v2 0/2] dmaengine: dw-axi-dmac: clean up DMAC enable and PM tze.yee.ng
2026-05-25  7:10 ` [PATCH v2 1/2] dmaengine: dw-axi-dmac: drop redundant DMAC enable in block start tze.yee.ng
2026-05-25  7:52   ` sashiko-bot
2026-05-25  7:10 ` [PATCH v2 2/2] dmaengine: dw-axi-dmac: fix PM for system sleep and channel alloc tze.yee.ng
2026-05-25  8:21   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox