summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/dc.c
diff options
context:
space:
mode:
authorAllen Yu <alleny@nvidia.com>2014-03-27 10:51:10 +0800
committerJon Mayo <jmayo@nvidia.com>2014-03-27 16:38:31 -0700
commit21461bf6cb137ddf080c24723b83d5d257dbb9e8 (patch)
treeeba409b2ac6e577ba786ec80ed7d8277ec5ad247 /drivers/video/tegra/dc/dc.c
parentdcee25f0c4e5da5f240ee550107a630847884ede (diff)
video: tegra: dc: protect interrupt masking
tegra_dc_unmask/mask_interrupt() should be called with dc->lock aquired. Otherwise, read/write DC_CMD_INT_MASK might be interleaved among seperate threads and results in a blurred interrupt masking. Bug 1473968 Bug 1475933 Change-Id: Id45bf2a733e949cdd8bbddc8ddc4152d78809d90 Signed-off-by: Allen Yu <alleny@nvidia.com> Reviewed-on: http://git-master/r/387432 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Chao Xu <cxu@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com> Tested-by: Jon Mayo <jmayo@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dc.c')
-rw-r--r--drivers/video/tegra/dc/dc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index f2098a1fa147..3dee4e3a2b89 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -1628,11 +1628,18 @@ int tegra_dc_wait_for_vsync(struct tegra_dc *dc)
mutex_lock(&dc->one_shot_lp_lock);
dc->out->user_needs_vblank = true;
+
+ mutex_lock(&dc->lock);
tegra_dc_unmask_interrupt(dc, MSF_INT);
+ mutex_unlock(&dc->lock);
ret = wait_for_completion_interruptible(&dc->out->user_vblank_comp);
init_completion(&dc->out->user_vblank_comp);
+
+ mutex_lock(&dc->lock);
tegra_dc_mask_interrupt(dc, MSF_INT);
+ mutex_unlock(&dc->lock);
+
mutex_unlock(&dc->one_shot_lp_lock);
if (dc->out_ops && dc->out_ops->release)