tegra_dsi_host_resume() may be called with dc->lock acquired. In this
case, if tegra_dsi_host_suspend() happens to be scheduled and trying
to acquired dc->lock while tegra_dsi_host_resume() is waiting for the
idle work to be cancelled, the deadlock would happen.
bug
1493581
Change-Id: I52ee435cb2d49523b323e2866db5c12ba02e1895
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/392215
(cherry picked from commit
40cc3cd27218ccc20162bea73d01e25a97c42da7)
Reviewed-on: http://git-master/r/393779
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
while (!tegra_dsi_host_suspend_trylock(dc, dsi))
cond_resched();
- if (dsi->host_suspended) {
+ if (dsi->host_suspended || atomic_read(&dsi->host_ref)) {
tegra_dsi_host_suspend_unlock(dc, dsi);
return 0;
}
if (!dsi->enabled)
return -EINVAL;
- cancel_delayed_work_sync(&dsi->idle_work);
+ cancel_delayed_work(&dsi->idle_work);
mutex_lock(&dsi->host_lock);
if (!dsi->host_suspended) {