Skip to content

Commit

Permalink
bus: ti-sysc: Fix warnings for unbind for serial
Browse files Browse the repository at this point in the history
[ Upstream commit c337125 ]

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: 76f0f77 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init")
Cc: Romain Naour <romain.naour@smile.fr>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20220512053021.61650-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tmlind authored and gregkh committed Jun 14, 2022
1 parent 985706b commit 7a6337b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/bus/ti-sysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3291,7 +3291,9 @@ static int sysc_remove(struct platform_device *pdev)
struct sysc *ddata = platform_get_drvdata(pdev);
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);
if (error < 0) {
Expand Down

0 comments on commit 7a6337b

Please sign in to comment.