Skip to content
Snippets Groups Projects
Commit c6ef11f8 authored by Han Xu's avatar Han Xu Committed by Leonard Crestez
Browse files

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: default avatarHan Xu <han.xu@nxp.com>
Reviewed-by: default avatarFrank 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: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: default avatarVipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: default avatarSrikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
parent cd40ecc7
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2011-2015 Freescale Semiconductor, Inc. All Rights Reserved.
* Copyright 2017 NXP
*
* Refer to drivers/dma/imx-sdma.c
*
......@@ -720,8 +721,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)
......@@ -749,10 +750,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;
}
......@@ -923,13 +924,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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment