There is a race condition between tegra_dsi_host_resume() and
tegra_dsi_host_suspend(). If dsi idle work happens to be executing
while we are calling tegra_dsi_host_resume(), the idle work will
not be canceled. In this case, if resume routine acquires host_lock
before suspend routine, we will end up executing suspend routine.
As a result, DSI host will not be hold in fact. This could lead to
some undesirable problems like wait_for_vsync will never be waken up
since TE is turned off.
To fix this, use cancel_delayed_work_sync API in tegra_dsi_host_resume()
instead of cancel_delayed_work.
Bug
1473968
Bug
1475933
Change-Id: Ifee61efcce45bcefabc97d7ed922b44ecd148ff0
Signed-off-by: Allen Yu <alleny@nvidia.com>
Reviewed-on: http://git-master/r/386322
(cherry picked from commit
03ccbf46d4830ab38f470dd94bc9397f20147fe0)
Reviewed-on: http://git-master/r/386699
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>
if (!dsi->enabled)
return -EINVAL;
- cancel_delayed_work(&dsi->idle_work);
+ cancel_delayed_work_sync(&dsi->idle_work);
mutex_lock(&dsi->host_lock);
if (!dsi->host_suspended) {