summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_sai.c
diff options
context:
space:
mode:
authorViorel Suman <viorel.suman@nxp.com>2020-04-30 20:29:47 +0300
committerViorel Suman <viorel.suman@nxp.com>2020-05-01 12:45:43 +0300
commit698861f0764bb9cdbc77b118f3a2105f979449a6 (patch)
treec646042ac07e5e28e97fabd0cbdfe1ba172bbe1c /sound/soc/fsl/fsl_sai.c
parent18b2111684bf921c5b5d9fc776b0bdf6e58a4cdf (diff)
MLK-23618-17: fsl_sai: fix hang in probe at boot time
A power domain associated with a device may be disabled in a separate thread by "genpd_power_off_work_fn" function in case the device has no PM runtime enabled at that moment. This will stop the parent clock of "bus" clk and hang the probe in regmap read/write operation. In order to avoid this PM runtime must be enabled before any regmap read/write ops. Aside of this replace clk bus clocks with pm_runtime_get/put_sync calls. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Fixes: c2641e1974f7 ("MLK-23618-9: ASoC: fsl_sai: Don't bind clock with regmap") Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_sai.c')
-rw-r--r--sound/soc/fsl/fsl_sai.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 0991e24fa45f..d3daa0239ec4 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1492,10 +1492,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, sai);
-
- ret = clk_prepare_enable(sai->bus_clk);
- if (ret)
- return ret;
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_get_sync(&pdev->dev);
ret = fsl_sai_check_ver(&pdev->dev);
if (ret < 0)
@@ -1542,7 +1540,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "fail to create sys group\n");
}
- clk_disable_unprepare(sai->bus_clk);
+ pm_runtime_put_sync(&pdev->dev);
sai->dma_params_rx.chan_name = "rx";
sai->dma_params_tx.chan_name = "tx";
@@ -1553,8 +1551,6 @@ static int fsl_sai_probe(struct platform_device *pdev)
sai->pinctrl = devm_pinctrl_get(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
-
regcache_cache_only(sai->regmap, true);
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,