diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 2 |
7 files changed, 22 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index cce7a769..7aae2584 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | |||
@@ -436,7 +436,7 @@ u32 gk20a_ce_create_context_with_cb(struct device *dev, | |||
436 | 436 | ||
437 | err = nvgpu_mutex_init(&ce_ctx->gpu_ctx_mutex); | 437 | err = nvgpu_mutex_init(&ce_ctx->gpu_ctx_mutex); |
438 | if (err) { | 438 | if (err) { |
439 | kfree(ce_ctx); | 439 | nvgpu_kfree(g, ce_ctx); |
440 | return ctx_id; | 440 | return ctx_id; |
441 | } | 441 | } |
442 | 442 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 7054e2a2..1ebb1900 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -85,14 +85,15 @@ static int alloc_session(struct gk20a *g, struct dbg_session_gk20a **_dbg_s) | |||
85 | return 0; | 85 | return 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | static int alloc_profiler(struct dbg_profiler_object_data **_prof) | 88 | static int alloc_profiler(struct gk20a *g, |
89 | struct dbg_profiler_object_data **_prof) | ||
89 | { | 90 | { |
90 | struct dbg_profiler_object_data *prof; | 91 | struct dbg_profiler_object_data *prof; |
91 | *_prof = NULL; | 92 | *_prof = NULL; |
92 | 93 | ||
93 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, ""); | 94 | gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, ""); |
94 | 95 | ||
95 | prof = kzalloc(sizeof(*prof), GFP_KERNEL); | 96 | prof = nvgpu_kzalloc(g, sizeof(*prof)); |
96 | if (!prof) | 97 | if (!prof) |
97 | return -ENOMEM; | 98 | return -ENOMEM; |
98 | 99 | ||
@@ -152,7 +153,7 @@ static int gk20a_dbg_gpu_do_dev_open(struct inode *inode, | |||
152 | err_destroy_lock: | 153 | err_destroy_lock: |
153 | nvgpu_mutex_destroy(&dbg_session->ch_list_lock); | 154 | nvgpu_mutex_destroy(&dbg_session->ch_list_lock); |
154 | err_free_session: | 155 | err_free_session: |
155 | kfree(dbg_session); | 156 | nvgpu_kfree(g, dbg_session); |
156 | free_ref: | 157 | free_ref: |
157 | gk20a_put(g); | 158 | gk20a_put(g); |
158 | return err; | 159 | return err; |
@@ -435,7 +436,7 @@ int dbg_unbind_single_channel_gk20a(struct dbg_session_gk20a *dbg_s, | |||
435 | release_profiler_reservation(dbg_s, prof_obj); | 436 | release_profiler_reservation(dbg_s, prof_obj); |
436 | } | 437 | } |
437 | list_del(&prof_obj->prof_obj_entry); | 438 | list_del(&prof_obj->prof_obj_entry); |
438 | kfree(prof_obj); | 439 | nvgpu_kfree(g, prof_obj); |
439 | } | 440 | } |
440 | } | 441 | } |
441 | 442 | ||
@@ -537,7 +538,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp) | |||
537 | g->ops.dbg_session_ops. | 538 | g->ops.dbg_session_ops. |
538 | release_profiler_reservation(dbg_s, prof_obj); | 539 | release_profiler_reservation(dbg_s, prof_obj); |
539 | list_del(&prof_obj->prof_obj_entry); | 540 | list_del(&prof_obj->prof_obj_entry); |
540 | kfree(prof_obj); | 541 | nvgpu_kfree(g, prof_obj); |
541 | } | 542 | } |
542 | } | 543 | } |
543 | nvgpu_mutex_release(&g->dbg_sessions_lock); | 544 | nvgpu_mutex_release(&g->dbg_sessions_lock); |
@@ -1527,7 +1528,7 @@ static int nvgpu_ioctl_allocate_profiler_object( | |||
1527 | 1528 | ||
1528 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); | 1529 | nvgpu_mutex_acquire(&g->dbg_sessions_lock); |
1529 | 1530 | ||
1530 | err = alloc_profiler(&prof_obj); | 1531 | err = alloc_profiler(g, &prof_obj); |
1531 | if (err) | 1532 | if (err) |
1532 | goto clean_up; | 1533 | goto clean_up; |
1533 | 1534 | ||
@@ -1540,7 +1541,7 @@ static int nvgpu_ioctl_allocate_profiler_object( | |||
1540 | if (prof_obj->ch == NULL) { | 1541 | if (prof_obj->ch == NULL) { |
1541 | gk20a_err(dev_from_gk20a(g), | 1542 | gk20a_err(dev_from_gk20a(g), |
1542 | "bind a channel for dbg session"); | 1543 | "bind a channel for dbg session"); |
1543 | kfree(prof_obj); | 1544 | nvgpu_kfree(g, prof_obj); |
1544 | err = -EINVAL; | 1545 | err = -EINVAL; |
1545 | goto clean_up; | 1546 | goto clean_up; |
1546 | } | 1547 | } |
@@ -1586,7 +1587,7 @@ static int nvgpu_ioctl_free_profiler_object( | |||
1586 | g->ops.dbg_session_ops. | 1587 | g->ops.dbg_session_ops. |
1587 | release_profiler_reservation(dbg_s, prof_obj); | 1588 | release_profiler_reservation(dbg_s, prof_obj); |
1588 | list_del(&prof_obj->prof_obj_entry); | 1589 | list_del(&prof_obj->prof_obj_entry); |
1589 | kfree(prof_obj); | 1590 | nvgpu_kfree(g, prof_obj); |
1590 | obj_found = true; | 1591 | obj_found = true; |
1591 | break; | 1592 | break; |
1592 | } | 1593 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index a8b9c5fb..7e7c9cb8 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c | |||
@@ -61,8 +61,7 @@ static void gk20a_debug_dump_all_channel_status_ramfc(struct gk20a *g, | |||
61 | u32 chid; | 61 | u32 chid; |
62 | struct ch_state **ch_state; | 62 | struct ch_state **ch_state; |
63 | 63 | ||
64 | ch_state = kzalloc(sizeof(*ch_state) | 64 | ch_state = nvgpu_kzalloc(g, sizeof(*ch_state) * f->num_channels); |
65 | * f->num_channels, GFP_KERNEL); | ||
66 | if (!ch_state) { | 65 | if (!ch_state) { |
67 | gk20a_debug_output(o, "cannot alloc memory for channels\n"); | 66 | gk20a_debug_output(o, "cannot alloc memory for channels\n"); |
68 | return; | 67 | return; |
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f7f39207..b2a6b1a0 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -3489,8 +3489,8 @@ static void __gk20a_fifo_profile_free(struct kref *ref) | |||
3489 | { | 3489 | { |
3490 | struct fifo_gk20a *f = container_of(ref, struct fifo_gk20a, | 3490 | struct fifo_gk20a *f = container_of(ref, struct fifo_gk20a, |
3491 | profile.ref); | 3491 | profile.ref); |
3492 | vfree(f->profile.data); | 3492 | nvgpu_vfree(f->g, f->profile.data); |
3493 | vfree(f->profile.sorted); | 3493 | nvgpu_vfree(f->g, f->profile.sorted); |
3494 | } | 3494 | } |
3495 | 3495 | ||
3496 | static int gk20a_fifo_profile_enable(void *data, u64 val) | 3496 | static int gk20a_fifo_profile_enable(void *data, u64 val) |
@@ -3518,8 +3518,8 @@ static int gk20a_fifo_profile_enable(void *data, u64 val) | |||
3518 | FIFO_PROFILING_ENTRIES * | 3518 | FIFO_PROFILING_ENTRIES * |
3519 | sizeof(u64)); | 3519 | sizeof(u64)); |
3520 | if (!(f->profile.data && f->profile.sorted)) { | 3520 | if (!(f->profile.data && f->profile.sorted)) { |
3521 | vfree(f->profile.data); | 3521 | nvgpu_vfree(g, f->profile.data); |
3522 | vfree(f->profile.sorted); | 3522 | nvgpu_vfree(g, f->profile.sorted); |
3523 | nvgpu_mutex_release(&f->profile.lock); | 3523 | nvgpu_mutex_release(&f->profile.lock); |
3524 | return -ENOMEM; | 3524 | return -ENOMEM; |
3525 | } | 3525 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 0e3bcdbe..3e9a388b 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -3343,13 +3343,16 @@ int gk20a_comptag_allocator_init(struct gk20a_comptag_allocator *allocator, | |||
3343 | 3343 | ||
3344 | void gk20a_comptag_allocator_destroy(struct gk20a_comptag_allocator *allocator) | 3344 | void gk20a_comptag_allocator_destroy(struct gk20a_comptag_allocator *allocator) |
3345 | { | 3345 | { |
3346 | struct gr_gk20a *gr = container_of(allocator, | ||
3347 | struct gr_gk20a, comp_tags); | ||
3348 | |||
3346 | /* | 3349 | /* |
3347 | * called only when exiting the driver (gk20a_remove, or unwinding the | 3350 | * called only when exiting the driver (gk20a_remove, or unwinding the |
3348 | * init stage); no users should be active, so taking the mutex is | 3351 | * init stage); no users should be active, so taking the mutex is |
3349 | * unnecessary here. | 3352 | * unnecessary here. |
3350 | */ | 3353 | */ |
3351 | allocator->size = 0; | 3354 | allocator->size = 0; |
3352 | vfree(allocator->bitmap); | 3355 | nvgpu_vfree(gr->g, allocator->bitmap); |
3353 | } | 3356 | } |
3354 | 3357 | ||
3355 | static void gk20a_remove_gr_support(struct gr_gk20a *gr) | 3358 | static void gk20a_remove_gr_support(struct gr_gk20a *gr) |
@@ -3419,7 +3422,7 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) | |||
3419 | nvgpu_kfree(g, gr->ctx_vars.ctxsw_regs.pm_ltc.l); | 3422 | nvgpu_kfree(g, gr->ctx_vars.ctxsw_regs.pm_ltc.l); |
3420 | nvgpu_kfree(g, gr->ctx_vars.ctxsw_regs.pm_fbpa.l); | 3423 | nvgpu_kfree(g, gr->ctx_vars.ctxsw_regs.pm_fbpa.l); |
3421 | 3424 | ||
3422 | vfree(gr->ctx_vars.local_golden_image); | 3425 | nvgpu_vfree(g, gr->ctx_vars.local_golden_image); |
3423 | gr->ctx_vars.local_golden_image = NULL; | 3426 | gr->ctx_vars.local_golden_image = NULL; |
3424 | 3427 | ||
3425 | if (gr->ctx_vars.hwpm_ctxsw_buffer_offset_map) | 3428 | if (gr->ctx_vars.hwpm_ctxsw_buffer_offset_map) |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 9a2dbeb9..461cf324 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -4188,7 +4188,7 @@ static int init_vm_page_tables(struct vm_gk20a *vm) | |||
4188 | err = gk20a_zalloc_gmmu_page_table(vm, 0, &vm->mmu_levels[0], | 4188 | err = gk20a_zalloc_gmmu_page_table(vm, 0, &vm->mmu_levels[0], |
4189 | &vm->pdb, NULL); | 4189 | &vm->pdb, NULL); |
4190 | if (err) { | 4190 | if (err) { |
4191 | vfree(vm->pdb.entries); | 4191 | nvgpu_vfree(vm->mm->g, vm->pdb.entries); |
4192 | return err; | 4192 | return err; |
4193 | } | 4193 | } |
4194 | 4194 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index 70e40099..6281e4ad 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | |||
@@ -260,7 +260,7 @@ struct tsg_gk20a *gk20a_tsg_open(struct gk20a *g) | |||
260 | if (g->ops.fifo.tsg_open) { | 260 | if (g->ops.fifo.tsg_open) { |
261 | err = g->ops.fifo.tsg_open(tsg); | 261 | err = g->ops.fifo.tsg_open(tsg); |
262 | if (err) { | 262 | if (err) { |
263 | gk20a_err(dev_from_gk20a(g), | 263 | gk20a_err(dev_from_gk20a(g), |
264 | "tsg %d fifo open failed %d", | 264 | "tsg %d fifo open failed %d", |
265 | tsg->tsgid, err); | 265 | tsg->tsgid, err); |
266 | goto clean_up; | 266 | goto clean_up; |