From b5b4353ca6cc9b6457ddccc00bf87538291870fc Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 20 Mar 2018 04:51:23 -0700 Subject: gpu: nvgpu: set safe state for user managed syncpoints MAX/threshold value of user managed syncpoint is not tracked by nvgpu So if channel is reset by nvgpu there could be waiters still waiting on some user syncpoint fence Fix this by setting a large safe value to user managed syncpoint when aborting the channel and when closing the channel We right now increment the current value by 0x10000 which should be sufficient to release any pending waiter Bug 200326065 Jira NVGPU-179 Change-Id: Ie6432369bb4c21bd922c14b8d5a74c1477116f0b Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1678768 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h index 3f44b27a..da8cb251 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h @@ -86,6 +86,13 @@ struct gk20a_channel_sync { /* Reset the channel syncpoint/semaphore. */ void (*set_min_eq_max)(struct gk20a_channel_sync *s); + /* + * Set the channel syncpoint/semaphore to safe state + * This should be used to reset User managed syncpoint since we don't + * track threshold values for those syncpoints + */ + void (*set_safe_state)(struct gk20a_channel_sync *s); + /* Signals the sync timeline (if owned by the gk20a_channel_sync layer). * This should be called when we notice that a gk20a_fence is * expired. */ @@ -101,7 +108,8 @@ struct gk20a_channel_sync { void (*destroy)(struct gk20a_channel_sync *s); }; -void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync); +void gk20a_channel_sync_destroy(struct gk20a_channel_sync *sync, + bool set_safe_state); struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c, bool user_managed); bool gk20a_channel_sync_needs_sync_framework(struct gk20a *g); -- cgit v1.2.2