summaryrefslogtreecommitdiff
path: root/drivers/dma/imx-sdma.c
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2018-07-18 16:14:34 +0300
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:32:44 +0800
commit69fd6ae9f8371a4bcb7398b3204b34d4131824ec (patch)
tree97a806524150d881be09367e48af05963f3ede60 /drivers/dma/imx-sdma.c
parent6a53e5e367fada6191c1b27313f47acc40011703 (diff)
MLK-18918: dma: imx-sdma: Mark fw_loaded false on resume
When the sdma engine is suspended firmware might get lost and need to be reloaded. Right now fw_loaded is set to false in suspend code and SDMA is disabled until FW is reloaded on resume. However when entering standby mode the firmware is not lost, the resume code detects this situation and skips reloading firmware and restoring contexts. Unfortunately this incorrectly leaves fw_loaded set to false so SDMA is unusable after a standby. Fix by setting fw_loaded to false at the start of sdma_resume instead of the end of sdma_suspend. This is the point at which we know that firmware was lost and needs reloading. Fixes: c5e50134e7b1 ("MLK-18315-1 dma: imx-sdma: add fw_loaded check") Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Acked-by: Fugang Duan <fugang.duan@nxp.com>
Diffstat (limited to 'drivers/dma/imx-sdma.c')
-rw-r--r--drivers/dma/imx-sdma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index efd11bab6957..988c5c76b2e2 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2520,8 +2520,6 @@ static int sdma_suspend(struct device *dev)
sdma->save_regs[i] = readl_relaxed(sdma->regs + 4 * i);
}
- sdma->fw_loaded = false;
-
clk_disable(sdma->clk_ipg);
clk_disable(sdma->clk_ahb);
@@ -2548,6 +2546,8 @@ static int sdma_resume(struct device *dev)
return 0;
}
+ /* Firmware was lost, mark as "not ready" */
+ sdma->fw_loaded = false;
sdma->suspend_off = true;
/* restore regs and load firmware */