Skip to content

Commit

Permalink
dmaengine: qcom: bam_dma: disable runtime pm on remote controlled
Browse files Browse the repository at this point in the history
Remotely controlled BAM instance should not do any power management from
CPU side, as cpu can not reliably say if the BAM is busy or not.

Disable it for such instances.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Srinivas Kandagatla authored and Vinod Koul committed Mar 1, 2018
1 parent 54eb5e2 commit 5b4a689
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/dma/qcom/bam_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,11 @@ static int bam_dma_probe(struct platform_device *pdev)
if (ret)
goto err_unregister_dma;

if (bdev->controlled_remotely) {
pm_runtime_disable(&pdev->dev);
return 0;
}

pm_runtime_irq_safe(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, BAM_DMA_AUTOSUSPEND_DELAY);
pm_runtime_use_autosuspend(&pdev->dev);
Expand Down Expand Up @@ -1416,7 +1421,8 @@ static int __maybe_unused bam_dma_suspend(struct device *dev)
{
struct bam_device *bdev = dev_get_drvdata(dev);

pm_runtime_force_suspend(dev);
if (!bdev->controlled_remotely)
pm_runtime_force_suspend(dev);

clk_unprepare(bdev->bamclk);

Expand All @@ -1432,7 +1438,8 @@ static int __maybe_unused bam_dma_resume(struct device *dev)
if (ret)
return ret;

pm_runtime_force_resume(dev);
if (!bdev->controlled_remotely)
pm_runtime_force_resume(dev);

return 0;
}
Expand Down

0 comments on commit 5b4a689

Please sign in to comment.