提交 dc62e1ae 编写于 作者: T Tony Lindgren 提交者: Zheng Zengkai

bus: ti-sysc: Fix warnings for unbind for serial

stable inclusion
from stable-v5.10.122
commit 7a6337bfedc5c736ca8ec3dce2cd883e296f7762
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7a6337bfedc5c736ca8ec3dce2cd883e296f7762

--------------------------------

[ Upstream commit c337125b ]

We can get "failed to disable" clock_unprepare warnings on unbind at least
for the serial console device if the unbind is done before the device has
been idled.

As some devices are using deferred idle, we must check the status for
pending idle work to idle the device.

Fixes: 76f0f772 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init")
Cc: Romain Naour <romain.naour@smile.fr>
Reviewed-by: NRomain Naour <romain.naour@smile.fr>
Signed-off-by: NTony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20220512053021.61650-1-tony@atomide.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 0316b4e4
...@@ -3291,7 +3291,9 @@ static int sysc_remove(struct platform_device *pdev) ...@@ -3291,7 +3291,9 @@ static int sysc_remove(struct platform_device *pdev)
struct sysc *ddata = platform_get_drvdata(pdev); struct sysc *ddata = platform_get_drvdata(pdev);
int error; int error;
cancel_delayed_work_sync(&ddata->idle_work); /* Device can still be enabled, see deferred idle quirk in probe */
if (cancel_delayed_work_sync(&ddata->idle_work))
ti_sysc_idle(&ddata->idle_work.work);
error = pm_runtime_get_sync(ddata->dev); error = pm_runtime_get_sync(ddata->dev);
if (error < 0) { if (error < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册