summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/driver_common.c
diff options
context:
space:
mode:
authorskadamati <skadamati@nvidia.com>2017-06-30 04:47:25 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-05 12:36:03 -0400
commite768e74df8be8abe8442d958bde7a4a2886694ba (patch)
tree9dc9b2adb04e9b2b674cd29267752ed4d3e3807f /drivers/gpu/nvgpu/common/linux/driver_common.c
parent8b36c45b39d06e273d00cd76180b589727dcde45 (diff)
gpu: nvgpu: Fix race condition during poweron
When two or more apps ran simultaneously First app context sets power_on flag & starts init Other app context check the power_on flag and try to use GPU without init completed Which makes aother apps to assert Added mutex to synchronize poweron access Bug 200297265 Change-Id: Ie138f7f43bb0dd3304ed91ae3649a6a4947bee91 Signed-off-by: skadamati <skadamati@nvidia.com> Reviewed-on: https://git-master/r/1511436 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/driver_common.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c
index c2bd9d78..b12917d6 100644
--- a/drivers/gpu/nvgpu/common/linux/driver_common.c
+++ b/drivers/gpu/nvgpu/common/linux/driver_common.c
@@ -50,6 +50,7 @@ static void nvgpu_init_vars(struct gk20a *g)
50 nvgpu_mutex_init(&platform->railgate_lock); 50 nvgpu_mutex_init(&platform->railgate_lock);
51 nvgpu_mutex_init(&g->dbg_sessions_lock); 51 nvgpu_mutex_init(&g->dbg_sessions_lock);
52 nvgpu_mutex_init(&g->client_lock); 52 nvgpu_mutex_init(&g->client_lock);
53 nvgpu_mutex_init(&g->poweron_lock);
53 nvgpu_mutex_init(&g->poweroff_lock); 54 nvgpu_mutex_init(&g->poweroff_lock);
54 55
55 g->regs_saved = g->regs; 56 g->regs_saved = g->regs;