Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: zynqmp_dma: Add shutdown operation support

Add shutdown callback to ensure that DMA operations are properly stopped
and resources are released during system shutdown or kexec operations.
Fix incorrect PM state handling in the remove function that was causing
clock disable warnings during the shutdown operations, which was not
implemented earlier. The original logic used pm_runtime_enabled() check
after calling the pm_runtime_disable(), would always evaluate to true
after the disable call, which leads to unconditionally calling the
runtime_suspend regardless of the device's actual power state.

During shutdown, the device may already be suspended with clock disabled
from the autosuspend timer, causing the clock framework to warn about
the double-disable attempt. The pm_runtime_active() function checks the
actual device power state rather than the PM subsystem's enabled/disabled
status. ensuring the runtime_suspend is only called when the device is in
active power state. This prevents clock warnings during shutdown while
maintaining proper cleanup during normal remove operations.

Signed-off-by: Abin Joseph <abin.joseph@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://lore.kernel.org/r/20250722070255.28944-1-abin.joseph@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Abin Joseph and committed by
Vinod Koul
72dd8b29 8f5ae30d

+3 -2
+3 -2
drivers/dma/xilinx/zynqmp_dma.c
··· 1173 1173 dma_async_device_unregister(&zdev->common); 1174 1174 1175 1175 zynqmp_dma_chan_remove(zdev->chan); 1176 - pm_runtime_disable(zdev->dev); 1177 - if (!pm_runtime_enabled(zdev->dev)) 1176 + if (pm_runtime_active(zdev->dev)) 1178 1177 zynqmp_dma_runtime_suspend(zdev->dev); 1178 + pm_runtime_disable(zdev->dev); 1179 1179 } 1180 1180 1181 1181 static const struct of_device_id zynqmp_dma_of_match[] = { ··· 1193 1193 }, 1194 1194 .probe = zynqmp_dma_probe, 1195 1195 .remove = zynqmp_dma_remove, 1196 + .shutdown = zynqmp_dma_remove, 1196 1197 }; 1197 1198 1198 1199 module_platform_driver(zynqmp_dma_driver);