From: bui duc phuc <[email protected]> Request the IRQ after fsl_asrc_init(), while the device is still runtime active, so that the interrupt handler cannot run before the device is initialized.
If requesting the IRQ fails, balance the runtime PM usage count before proceeding with cleanup. Signed-off-by: bui duc phuc <[email protected]> --- sound/soc/fsl/fsl_asrc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index f7ac60724c6c..c97f814d7358 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -1299,11 +1299,6 @@ static int fsl_asrc_probe(struct platform_device *pdev) if (irq < 0) return irq; - ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0, - dev_name(&pdev->dev), asrc); - if (ret) - return ret; - asrc->mem_clk = devm_clk_get(&pdev->dev, "mem"); if (IS_ERR(asrc->mem_clk)) return dev_err_probe(&pdev->dev, PTR_ERR(asrc->mem_clk), @@ -1436,6 +1431,14 @@ static int fsl_asrc_probe(struct platform_device *pdev) goto err_pm_get_sync; } + /* Request the IRQ only once the device is initialized */ + ret = devm_request_irq(&pdev->dev, irq, fsl_asrc_isr, 0, + dev_name(&pdev->dev), asrc); + if (ret) { + pm_runtime_put_noidle(&pdev->dev); + goto err_pm_get_sync; + } + ret = pm_runtime_put_sync(&pdev->dev); if (ret < 0 && ret != -ENOSYS) goto err_pm_get_sync; -- 2.43.0
