From 9e02111a768ab631a6719c1eae8d7c03e6e89c23 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 28 Jan 2016 10:54:32 -0800 Subject: gpu: nvgpu: fix race condition with poweroff When gpu rail-gating is enabled, it is possible that both rail gating code and system shudown can start executing gk20a_pm_prepare_poweroff() in parallel. To synchronize this execution, protect gk20a_pm_prepare_poweroff() with a mutex lock. Bug 200168805 Change-Id: I19536a43ed20c3e82b32c316922dc3e19e3f59bb Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/999548 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index b02d6111..0207588f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -521,6 +521,8 @@ struct gk20a { struct mutex ch_wdt_lock; + struct mutex poweroff_lock; + /* Channel priorities */ u32 timeslice_low_priority_us; u32 timeslice_medium_priority_us; -- cgit v1.2.2