Skip to content

Commit 5b78fac

Browse files
dinghaoliuvinodkoul
authored andcommitted
dmaengine: tegra210-adma: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8995aa3 commit 5b78fac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/dma/tegra210-adma.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc)
658658

659659
ret = pm_runtime_get_sync(tdc2dev(tdc));
660660
if (ret < 0) {
661+
pm_runtime_put_noidle(tdc2dev(tdc));
661662
free_irq(tdc->irq, tdc);
662663
return ret;
663664
}
@@ -869,8 +870,10 @@ static int tegra_adma_probe(struct platform_device *pdev)
869870
pm_runtime_enable(&pdev->dev);
870871

871872
ret = pm_runtime_get_sync(&pdev->dev);
872-
if (ret < 0)
873+
if (ret < 0) {
874+
pm_runtime_put_noidle(&pdev->dev);
873875
goto rpm_disable;
876+
}
874877

875878
ret = tegra_adma_init(tdma);
876879
if (ret)

0 commit comments

Comments
 (0)