From 821d1cab904d055264bc5d62b0c0d5187417ff13 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 8 Jun 2017 10:13:51 -0700 Subject: gpu: nvgpu: Move error notifier free to Linux module Freeing error notifier involves calling dma_buf API, which is Linux specific. Move the free to happen in Linux specific channel close path. JIRA NVGPU-65 Change-Id: Ifd8b31bb8c8af13975c34add00f51dd869cfd76a Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1498583 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index fad6b6af..49d83069 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -17,7 +17,10 @@ */ #include + +#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_GK20A_CYCLE_STATS) #include +#endif #include #include @@ -389,19 +392,6 @@ void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error) nvgpu_mutex_release(&ch->error_notifier_mutex); } -void gk20a_channel_free_error_notifiers(struct channel_gk20a *ch) -{ - nvgpu_mutex_acquire(&ch->error_notifier_mutex); - if (ch->error_notifier_ref) { - dma_buf_vunmap(ch->error_notifier_ref, ch->error_notifier_va); - dma_buf_put(ch->error_notifier_ref); - ch->error_notifier_ref = NULL; - ch->error_notifier = NULL; - ch->error_notifier_va = NULL; - } - nvgpu_mutex_release(&ch->error_notifier_mutex); -} - static void gk20a_wait_until_counter_is_N( struct channel_gk20a *ch, atomic_t *counter, int wait_value, struct nvgpu_cond *c, const char *caller, const char *counter_name) @@ -528,8 +518,6 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) gk20a_dbg_info("freeing bound channel context, timeout=%ld", timeout); - gk20a_channel_free_error_notifiers(ch); - if (g->ops.fecs_trace.unbind_channel && !ch->vpr) g->ops.fecs_trace.unbind_channel(g, ch); -- cgit v1.2.2