]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
video: tegra: dsi: Fix race condition in holding dsi host
authorAllen Yu <alleny@nvidia.com>
Tue, 25 Mar 2014 11:21:57 +0000 (19:21 +0800)
committerMrutyunjay Sawant <msawant@nvidia.com>
Fri, 28 Mar 2014 11:03:32 +0000 (04:03 -0700)
commit81eeb63c45813feeeb23d572d7f18f230459b0d4
tree498dffb979961446a247fc69bbee7bc24ad5fe0b
parent43100ffae28a3bb78c28b85bf1a238d6d9a7d4f4
video: tegra: dsi: Fix race condition in holding dsi host

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>
drivers/video/tegra/dc/dsi.c