Skip to content
Snippets Groups Projects
Commit d34082ef authored by Clark Wang's avatar Clark Wang
Browse files

LF-4174 i2c: imx-lpi2c: fix runtime pm issue when defer probe occurs


When the defer probe occurs, the pm_runtime_put() used before may
cause runtime pm to be disabled before clks of device truly closed.
So use pm_runtime_put_sync() in the error path to suspend it
immediately and put pm_runtime_disable() to the last.

Signed-off-by: default avatarClark Wang <xiaoning.wang@nxp.com>
Reviewed-by: default avatarJun Li <jun.li@nxp.com>
Reviewed-by: default avatarHaibo Chen <haibo.chen@nxp.com>
parent 49fd05c1
No related branches found
No related tags found
No related merge requests found
......@@ -952,8 +952,6 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
lpi2c_imx->txfifosize = 1 << (temp & 0x0f);
lpi2c_imx->rxfifosize = 1 << ((temp >> 8) & 0x0f);
pm_runtime_put(&pdev->dev);
/* Init optional bus recovery function */
ret = lpi2c_imx_init_recovery_info(lpi2c_imx, pdev);
/* Give it another chance if pinctrl used is not ready yet */
......@@ -976,13 +974,17 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
if (ret)
goto rpm_disable;
pm_runtime_mark_last_busy(&pdev->dev);
pm_runtime_put_autosuspend(&pdev->dev);
dev_info(&lpi2c_imx->adapter.dev, "LPI2C adapter registered\n");
return 0;
rpm_disable:
pm_runtime_disable(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
return ret;
}
......
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