Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dmaengine: pl330: Fix unbalanced runtime PM
This driver use runtime PM autosuspend mechanism to manager clk. pm_runtime_use_autosuspend(&adev->dev); pm_runtime_set_autosuspend_delay(&adev->dev, PL330_AUTOSUSPEND_DELAY); So, after ref count reached to zero, it will enter suspend after the delay time elapsed. The unbalanced PM: * May cause dmac the next start failed. * May cause dmac read unexpected state. * May cause dmac stall if power down happen at the middle of the transfer. e.g. may lose ack from AXI bus and stall. Considering the following situation: DMA TERMINATE TASKLET ROUTINE | | | issue_pending | | | pch->active = true | pm_runtime_get pm_runtime_put(if active) | pch->active = false | | work_list empty | | | pm_runtime_put(force) | | At this point, it's unbalanced(1 get / 2 put). After this patch: DMA TERMINATE TASKLET ROUTINE | | | issue_pending | | | pch->active = true | pm_runtime_get pm_runtime_put(if active) | pch->active = false | | work_list empty | | | pm_runtime_put(if active) | | Now, it's balanced(1 get / 1 put). Fixes: commit 5c9e6c2 ("dmaengine: pl330: Fix runtime PM support for terminated transfers") commit ae43b32 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12") Change-Id: Ib1feb508c16afb4bc9ced0c3660f2b6b4a19c068 Signed-off-by: Huibin Hong <[email protected]> Signed-off-by: Sugar Zhang <[email protected]>
- Loading branch information