summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-08 13:13:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-08 22:13:34 -0400
commit821d1cab904d055264bc5d62b0c0d5187417ff13 (patch)
treec2e3a395e43374e84fb8b8dc3d8349ff6168a0af /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent1dfcf1833ba3e8fa58d0ad6ecb189db32c6b986f (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1498583 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c18
1 files changed, 3 insertions, 15 deletions
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 @@
17 */ 17 */
18 18
19#include <trace/events/gk20a.h> 19#include <trace/events/gk20a.h>
20
21#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_GK20A_CYCLE_STATS)
20#include <linux/dma-buf.h> 22#include <linux/dma-buf.h>
23#endif
21 24
22#include <nvgpu/semaphore.h> 25#include <nvgpu/semaphore.h>
23#include <nvgpu/timers.h> 26#include <nvgpu/timers.h>
@@ -389,19 +392,6 @@ void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error)
389 nvgpu_mutex_release(&ch->error_notifier_mutex); 392 nvgpu_mutex_release(&ch->error_notifier_mutex);
390} 393}
391 394
392void gk20a_channel_free_error_notifiers(struct channel_gk20a *ch)
393{
394 nvgpu_mutex_acquire(&ch->error_notifier_mutex);
395 if (ch->error_notifier_ref) {
396 dma_buf_vunmap(ch->error_notifier_ref, ch->error_notifier_va);
397 dma_buf_put(ch->error_notifier_ref);
398 ch->error_notifier_ref = NULL;
399 ch->error_notifier = NULL;
400 ch->error_notifier_va = NULL;
401 }
402 nvgpu_mutex_release(&ch->error_notifier_mutex);
403}
404
405static void gk20a_wait_until_counter_is_N( 395static void gk20a_wait_until_counter_is_N(
406 struct channel_gk20a *ch, atomic_t *counter, int wait_value, 396 struct channel_gk20a *ch, atomic_t *counter, int wait_value,
407 struct nvgpu_cond *c, const char *caller, const char *counter_name) 397 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)
528 gk20a_dbg_info("freeing bound channel context, timeout=%ld", 518 gk20a_dbg_info("freeing bound channel context, timeout=%ld",
529 timeout); 519 timeout);
530 520
531 gk20a_channel_free_error_notifiers(ch);
532
533 if (g->ops.fecs_trace.unbind_channel && !ch->vpr) 521 if (g->ops.fecs_trace.unbind_channel && !ch->vpr)
534 g->ops.fecs_trace.unbind_channel(g, ch); 522 g->ops.fecs_trace.unbind_channel(g, ch);
535 523