From b063870f909f368820ae9b0726407d18dc28f24c Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 14 Feb 2018 18:12:47 +0200 Subject: gpu: nvgpu: BUG_ON for sema increment, not value When adding a sema wait to a pushbuf, verify that the sema threshold has been incremented from the original value by reading the incremented field instead of value (which is set to nonzero by nvgpu_semaphore_incr()). Value could be 0 even after an increment if new semas weren't reset to 0. Jira NVGPU-514 Change-Id: I295451fbc7eb9e597aea12d73074e99f74a6a899 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1658100 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 9649c573..85c55955 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -625,7 +625,7 @@ static int __semaphore_wait_fd_fast_path(struct channel_gk20a *c, return err; nvgpu_semaphore_get(sema); - BUG_ON(!nvgpu_atomic_read(&sema->value)); + BUG_ON(!sema->incremented); add_sema_cmd(c->g, c, sema, wait_cmd, 8, true, false); /* -- cgit v1.2.2