From 698861f0764bb9cdbc77b118f3a2105f979449a6 Mon Sep 17 00:00:00 2001 From: Viorel Suman Date: Thu, 30 Apr 2020 20:29:47 +0300 Subject: 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 Fixes: c2641e1974f7 ("MLK-23618-9: ASoC: fsl_sai: Don't bind clock with regmap") Reviewed-by: Shengjiu Wang --- sound/soc/fsl/fsl_sai.c | 10 +++------- 1 file 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, -- cgit v1.2.3