video: tegra: dc: protect unpin handle using mutex
authorPrafull Suryawanshi <prafulls@nvidia.com>
Wed, 13 Jul 2016 09:14:11 +0000 (14:14 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 2 Nov 2016 04:11:23 +0000 (21:11 -0700)
commitc62134f4928aa2e1112988835acfe322b15eaf33
tree29acaa71288ed63947982a6e22a7efd9a355bd51
parent98852f69fe5e5c59a574f22024495dd61bf4fc9b
video: tegra: dc: protect unpin handle using mutex

bug 200208064

This change fixes the race condition where detach dma buffer
happens due to parallel paths in dc driver.
hpd worker and fb blank calls unpin window which unpin dma handles.
This is also done by flip_worker. There is possibility that same
buffer can be detached twice causing kernel panic. This change
protects cur_handle which is referred before doing unpin dma handles.

Change-Id: I8fa317d8d5fe62724c44c3630f71739ebb0c23ed
Signed-off-by: Prafull Suryawanshi <prafulls@nvidia.com>
Reviewed-on: http://git-master/r/1180645
(cherry picked from commit f48c266c999337b216abe3f49d709843b58d2fdb)
Reviewed-on: http://git-master/r/1199050
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/video/tegra/dc/ext/dev.c
drivers/video/tegra/dc/ext/tegra_dc_ext_priv.h