MLK-16786: dma: mxs-dma: fix the unbalanced runtime pm counter
mxs-dma init function will call runtime pm init, the redundant pm_runtime_force_resume will mess up the counter. Also remove some unnecessary code. Signed-off-by: Han Xu <han.xu@nxp.com> Reviewed-by: Frank Li <frank.li@nxp.com> During 4.14 rebase squashed the following: MLK-16800: dma: mxs-dma: correctly handle mxs-dma clock enable mxs-dma clock before HW reset and disable clock after it. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>pull/10/head
parent
61d9435fce
commit
8ac8243ce8
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright 2011-2015 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
* Copyright 2017 NXP
|
||||
*
|
||||
* Refer to drivers/dma/imx-sdma.c
|
||||
*
|
||||
|
@ -728,8 +729,8 @@ static int mxs_dma_init_rpm(struct mxs_dma_engine *mxs_dma)
|
|||
|
||||
static int mxs_dma_init(struct mxs_dma_engine *mxs_dma)
|
||||
{
|
||||
int ret;
|
||||
struct device *dev = &mxs_dma->pdev->dev;
|
||||
int ret;
|
||||
|
||||
ret = mxs_dma_init_rpm(mxs_dma);
|
||||
if (ret)
|
||||
|
@ -757,10 +758,10 @@ static int mxs_dma_init(struct mxs_dma_engine *mxs_dma)
|
|||
writel(MXS_DMA_CHANNELS_MASK << MXS_DMA_CHANNELS,
|
||||
mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_SET);
|
||||
|
||||
err_clk:
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
pm_runtime_put_autosuspend(dev);
|
||||
|
||||
err_clk:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -934,13 +935,10 @@ static int mxs_dma_pm_resume(struct device *dev)
|
|||
struct mxs_dma_engine *mxs_dma = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
ret = pm_runtime_force_resume(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = mxs_dma_init(mxs_dma);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue