From 19b8f854ce5861598bb7749775440bd2f946c348 Mon Sep 17 00:00:00 2001 From: Arto Merilainen Date: Tue, 5 Aug 2014 17:50:51 +0300 Subject: gpu: nvgpu: Fix semaphore refcounting This patch fixes a refcounting issue in semaphore handling. Change-Id: I03327c60ed6923a90663f0b845566e81af4b94d4 Signed-off-by: Arto Merilainen Reviewed-on: http://git-master/r/453056 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 4d366fa9..ef9e3a37 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -458,6 +458,9 @@ static int gk20a_channel_semaphore_wait_fd( goto fail; } + /* worker takes one reference */ + gk20a_semaphore_get(w->sema); + gk20a_channel_alloc_priv_cmdbuf(c, 8, &wait_cmd); if (wait_cmd == NULL) { gk20a_err(dev_from_gk20a(c->g), -- cgit v1.2.2