summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-09-21 17:24:59 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-26 14:10:01 -0400
commit2fa54c94a67e13d84df980d646674dde0ad27168 (patch)
tree2bf49a012542caa2ad278392b313305f74fe96f6 /drivers/gpu/nvgpu
parent93eea1d72934b28db4707e5aa7ab4dab65d89551 (diff)
gpu: nvgpu: Remove global debugfs variable
Remove a global debugfs variable and instead save the allocator debugfs root node in the gk20a struct. Bug 1799159 Change-Id: If4eed34fa24775e962001e34840b334658f2321c Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1225611 (cherry picked from commit 1908fde10bb1fb60ce898ea329f5a441a3e4297a) Reviewed-on: http://git-master/r/1242390 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator.c27
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator.h14
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c11
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_lockless.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c12
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c10
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c6
11 files changed, 58 insertions, 41 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index 4673f28c..737ad1b1 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -129,9 +129,9 @@ int gk20a_alloc_fence_pool(struct channel_gk20a *c, int count)
129 if (!fence_pool) 129 if (!fence_pool)
130 return -ENOMEM; 130 return -ENOMEM;
131 131
132 err = gk20a_lockless_allocator_init(&c->fence_allocator, 132 err = gk20a_lockless_allocator_init(c->g, &c->fence_allocator,
133 "fence_pool", (size_t)fence_pool, size, 133 "fence_pool", (size_t)fence_pool, size,
134 sizeof(struct gk20a_fence), 0); 134 sizeof(struct gk20a_fence), 0);
135 if (err) 135 if (err)
136 goto fail; 136 goto fail;
137 137
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 635dddc4..58e69cbe 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -834,6 +834,7 @@ struct gk20a {
834 struct dentry *debugfs_timeslice_medium_priority_us; 834 struct dentry *debugfs_timeslice_medium_priority_us;
835 struct dentry *debugfs_timeslice_high_priority_us; 835 struct dentry *debugfs_timeslice_high_priority_us;
836 struct dentry *debugfs_runlist_interleave; 836 struct dentry *debugfs_runlist_interleave;
837 struct dentry *debugfs_allocators;
837 struct dentry *debugfs_xve; 838 struct dentry *debugfs_xve;
838#endif 839#endif
839 struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; 840 struct gk20a_ctxsw_ucode_info ctxsw_ucode_info;
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c
index 15d5b732..3129b07c 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c
@@ -19,14 +19,13 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#include "gk20a.h"
22#include "mm_gk20a.h" 23#include "mm_gk20a.h"
23#include "platform_gk20a.h" 24#include "platform_gk20a.h"
24#include "gk20a_allocator.h" 25#include "gk20a_allocator.h"
25 26
26u32 gk20a_alloc_tracing_on; 27u32 gk20a_alloc_tracing_on;
27 28
28static struct dentry *gk20a_alloc_debugfs_root;
29
30u64 gk20a_alloc_length(struct gk20a_allocator *a) 29u64 gk20a_alloc_length(struct gk20a_allocator *a)
31{ 30{
32 if (a->ops->length) 31 if (a->ops->length)
@@ -152,6 +151,7 @@ void gk20a_alloc_print_stats(struct gk20a_allocator *__a,
152 __a->ops->print_stats(__a, s, lock); 151 __a->ops->print_stats(__a, s, lock);
153} 152}
154 153
154#ifdef CONFIG_DEBUG_FS
155static int __alloc_show(struct seq_file *s, void *unused) 155static int __alloc_show(struct seq_file *s, void *unused)
156{ 156{
157 struct gk20a_allocator *a = s->private; 157 struct gk20a_allocator *a = s->private;
@@ -172,35 +172,40 @@ static const struct file_operations __alloc_fops = {
172 .llseek = seq_lseek, 172 .llseek = seq_lseek,
173 .release = single_release, 173 .release = single_release,
174}; 174};
175#endif
175 176
176void gk20a_init_alloc_debug(struct gk20a_allocator *a) 177void gk20a_init_alloc_debug(struct gk20a *g, struct gk20a_allocator *a)
177{ 178{
178 if (!gk20a_alloc_debugfs_root) 179#ifdef CONFIG_DEBUG_FS
180 if (!g->debugfs_allocators)
179 return; 181 return;
180 182
181 a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO, 183 a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO,
182 gk20a_alloc_debugfs_root, 184 g->debugfs_allocators,
183 a, &__alloc_fops); 185 a, &__alloc_fops);
186#endif
184} 187}
185 188
186void gk20a_fini_alloc_debug(struct gk20a_allocator *a) 189void gk20a_fini_alloc_debug(struct gk20a_allocator *a)
187{ 190{
188 if (!gk20a_alloc_debugfs_root) 191#ifdef CONFIG_DEBUG_FS
189 return;
190
191 if (!IS_ERR_OR_NULL(a->debugfs_entry)) 192 if (!IS_ERR_OR_NULL(a->debugfs_entry))
192 debugfs_remove(a->debugfs_entry); 193 debugfs_remove(a->debugfs_entry);
194#endif
193} 195}
194 196
195void gk20a_alloc_debugfs_init(struct device *dev) 197void gk20a_alloc_debugfs_init(struct device *dev)
196{ 198{
199#ifdef CONFIG_DEBUG_FS
197 struct gk20a_platform *platform = dev_get_drvdata(dev); 200 struct gk20a_platform *platform = dev_get_drvdata(dev);
198 struct dentry *gpu_root = platform->debugfs; 201 struct dentry *gpu_root = platform->debugfs;
202 struct gk20a *g = get_gk20a(dev);
199 203
200 gk20a_alloc_debugfs_root = debugfs_create_dir("allocators", gpu_root); 204 g->debugfs_allocators = debugfs_create_dir("allocators", gpu_root);
201 if (IS_ERR_OR_NULL(gk20a_alloc_debugfs_root)) 205 if (IS_ERR_OR_NULL(g->debugfs_allocators))
202 return; 206 return;
203 207
204 debugfs_create_u32("tracing", 0664, gk20a_alloc_debugfs_root, 208 debugfs_create_u32("tracing", 0664, g->debugfs_allocators,
205 &gk20a_alloc_tracing_on); 209 &gk20a_alloc_tracing_on);
210#endif
206} 211}
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h
index dc065ffa..b12926b3 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.h
@@ -26,6 +26,7 @@
26struct gk20a_allocator; 26struct gk20a_allocator;
27struct gk20a_alloc_carveout; 27struct gk20a_alloc_carveout;
28struct vm_gk20a; 28struct vm_gk20a;
29struct gk20a;
29 30
30/* 31/*
31 * Operations for an allocator to implement. 32 * Operations for an allocator to implement.
@@ -173,25 +174,25 @@ static inline void alloc_unlock(struct gk20a_allocator *a)
173/* 174/*
174 * Buddy allocator specific initializers. 175 * Buddy allocator specific initializers.
175 */ 176 */
176int __gk20a_buddy_allocator_init(struct gk20a_allocator *a, 177int __gk20a_buddy_allocator_init(struct gk20a *g, struct gk20a_allocator *a,
177 struct vm_gk20a *vm, const char *name, 178 struct vm_gk20a *vm, const char *name,
178 u64 base, u64 size, u64 blk_size, 179 u64 base, u64 size, u64 blk_size,
179 u64 max_order, u64 flags); 180 u64 max_order, u64 flags);
180int gk20a_buddy_allocator_init(struct gk20a_allocator *allocator, 181int gk20a_buddy_allocator_init(struct gk20a *g, struct gk20a_allocator *a,
181 const char *name, u64 base, u64 size, 182 const char *name, u64 base, u64 size,
182 u64 blk_size, u64 flags); 183 u64 blk_size, u64 flags);
183 184
184/* 185/*
185 * Bitmap initializers. 186 * Bitmap initializers.
186 */ 187 */
187int gk20a_bitmap_allocator_init(struct gk20a_allocator *__a, 188int gk20a_bitmap_allocator_init(struct gk20a *g, struct gk20a_allocator *a,
188 const char *name, u64 base, u64 length, 189 const char *name, u64 base, u64 length,
189 u64 blk_size, u64 flags); 190 u64 blk_size, u64 flags);
190 191
191/* 192/*
192 * Page allocator initializers. 193 * Page allocator initializers.
193 */ 194 */
194int gk20a_page_allocator_init(struct gk20a_allocator *__a, 195int gk20a_page_allocator_init(struct gk20a *g, struct gk20a_allocator *a,
195 const char *name, u64 base, u64 length, 196 const char *name, u64 base, u64 length,
196 u64 blk_size, u64 flags); 197 u64 blk_size, u64 flags);
197 198
@@ -200,7 +201,7 @@ int gk20a_page_allocator_init(struct gk20a_allocator *__a,
200 * Note: This allocator can only allocate fixed-size structures of a 201 * Note: This allocator can only allocate fixed-size structures of a
201 * pre-defined size. 202 * pre-defined size.
202 */ 203 */
203int gk20a_lockless_allocator_init(struct gk20a_allocator *__a, 204int gk20a_lockless_allocator_init(struct gk20a *g, struct gk20a_allocator *a,
204 const char *name, u64 base, u64 length, 205 const char *name, u64 base, u64 length,
205 u64 struct_size, u64 flags); 206 u64 struct_size, u64 flags);
206 207
@@ -234,8 +235,9 @@ void gk20a_alloc_print_stats(struct gk20a_allocator *a,
234/* 235/*
235 * Common functionality for the internals of the allocators. 236 * Common functionality for the internals of the allocators.
236 */ 237 */
237void gk20a_init_alloc_debug(struct gk20a_allocator *a); 238void gk20a_init_alloc_debug(struct gk20a *g, struct gk20a_allocator *a);
238void gk20a_fini_alloc_debug(struct gk20a_allocator *a); 239void gk20a_fini_alloc_debug(struct gk20a_allocator *a);
240
239int __gk20a_alloc_common_init(struct gk20a_allocator *a, 241int __gk20a_alloc_common_init(struct gk20a_allocator *a,
240 const char *name, void *priv, bool dbg, 242 const char *name, void *priv, bool dbg,
241 const struct gk20a_allocator_ops *ops); 243 const struct gk20a_allocator_ops *ops);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c
index 03ccbe85..f98e0782 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c
@@ -371,7 +371,7 @@ static const struct gk20a_allocator_ops bitmap_ops = {
371}; 371};
372 372
373 373
374int gk20a_bitmap_allocator_init(struct gk20a_allocator *__a, 374int gk20a_bitmap_allocator_init(struct gk20a *g, struct gk20a_allocator *__a,
375 const char *name, u64 base, u64 length, 375 const char *name, u64 base, u64 length,
376 u64 blk_size, u64 flags) 376 u64 blk_size, u64 flags)
377{ 377{
@@ -426,7 +426,7 @@ int gk20a_bitmap_allocator_init(struct gk20a_allocator *__a,
426 wmb(); 426 wmb();
427 a->inited = true; 427 a->inited = true;
428 428
429 gk20a_init_alloc_debug(__a); 429 gk20a_init_alloc_debug(g, __a);
430 alloc_dbg(__a, "New allocator: type bitmap\n"); 430 alloc_dbg(__a, "New allocator: type bitmap\n");
431 alloc_dbg(__a, " base 0x%llx\n", a->base); 431 alloc_dbg(__a, " base 0x%llx\n", a->base);
432 alloc_dbg(__a, " bit_offs 0x%llx\n", a->bit_offs); 432 alloc_dbg(__a, " bit_offs 0x%llx\n", a->bit_offs);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
index a8a031be..3715e9f8 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
@@ -1218,7 +1218,7 @@ static const struct gk20a_allocator_ops buddy_ops = {
1218 * will try and pick a reasonable max order. 1218 * will try and pick a reasonable max order.
1219 * @flags: Extra flags necessary. See GPU_BALLOC_*. 1219 * @flags: Extra flags necessary. See GPU_BALLOC_*.
1220 */ 1220 */
1221int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a, 1221int __gk20a_buddy_allocator_init(struct gk20a *g, struct gk20a_allocator *__a,
1222 struct vm_gk20a *vm, const char *name, 1222 struct vm_gk20a *vm, const char *name,
1223 u64 base, u64 size, u64 blk_size, 1223 u64 base, u64 size, u64 blk_size,
1224 u64 max_order, u64 flags) 1224 u64 max_order, u64 flags)
@@ -1303,7 +1303,7 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a,
1303 wmb(); 1303 wmb();
1304 a->initialized = 1; 1304 a->initialized = 1;
1305 1305
1306 gk20a_init_alloc_debug(__a); 1306 gk20a_init_alloc_debug(g, __a);
1307 alloc_dbg(__a, "New allocator: type buddy\n"); 1307 alloc_dbg(__a, "New allocator: type buddy\n");
1308 alloc_dbg(__a, " base 0x%llx\n", a->base); 1308 alloc_dbg(__a, " base 0x%llx\n", a->base);
1309 alloc_dbg(__a, " size 0x%llx\n", a->length); 1309 alloc_dbg(__a, " size 0x%llx\n", a->length);
@@ -1318,9 +1318,10 @@ fail:
1318 return err; 1318 return err;
1319} 1319}
1320 1320
1321int gk20a_buddy_allocator_init(struct gk20a_allocator *a, const char *name, 1321int gk20a_buddy_allocator_init(struct gk20a *g, struct gk20a_allocator *a,
1322 u64 base, u64 size, u64 blk_size, u64 flags) 1322 const char *name, u64 base, u64 size,
1323 u64 blk_size, u64 flags)
1323{ 1324{
1324 return __gk20a_buddy_allocator_init(a, NULL, name, 1325 return __gk20a_buddy_allocator_init(g, a, NULL, name,
1325 base, size, blk_size, 0, 0); 1326 base, size, blk_size, 0, 0);
1326} 1327}
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_lockless.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_lockless.c
index 32455c98..5b011d8c 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_lockless.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_lockless.c
@@ -102,6 +102,8 @@ static void gk20a_lockless_alloc_destroy(struct gk20a_allocator *a)
102{ 102{
103 struct gk20a_lockless_allocator *pa = a->priv; 103 struct gk20a_lockless_allocator *pa = a->priv;
104 104
105 gk20a_fini_alloc_debug(a);
106
105 vfree(pa->next); 107 vfree(pa->next);
106 kfree(pa); 108 kfree(pa);
107} 109}
@@ -137,7 +139,7 @@ static const struct gk20a_allocator_ops pool_ops = {
137 .print_stats = gk20a_lockless_print_stats, 139 .print_stats = gk20a_lockless_print_stats,
138}; 140};
139 141
140int gk20a_lockless_allocator_init(struct gk20a_allocator *__a, 142int gk20a_lockless_allocator_init(struct gk20a *g, struct gk20a_allocator *__a,
141 const char *name, u64 base, u64 length, 143 const char *name, u64 base, u64 length,
142 u64 blk_size, u64 flags) 144 u64 blk_size, u64 flags)
143{ 145{
@@ -189,7 +191,7 @@ int gk20a_lockless_allocator_init(struct gk20a_allocator *__a,
189 wmb(); 191 wmb();
190 a->inited = true; 192 a->inited = true;
191 193
192 gk20a_init_alloc_debug(__a); 194 gk20a_init_alloc_debug(g, __a);
193 alloc_dbg(__a, "New allocator: type lockless\n"); 195 alloc_dbg(__a, "New allocator: type lockless\n");
194 alloc_dbg(__a, " base 0x%llx\n", a->base); 196 alloc_dbg(__a, " base 0x%llx\n", a->base);
195 alloc_dbg(__a, " nodes %d\n", a->nr_nodes); 197 alloc_dbg(__a, " nodes %d\n", a->nr_nodes);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
index 94d30abf..f670fd98 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
@@ -866,9 +866,9 @@ static int gk20a_page_alloc_init_slabs(struct gk20a_page_allocator *a)
866 return 0; 866 return 0;
867} 867}
868 868
869int gk20a_page_allocator_init(struct gk20a_allocator *__a, 869int gk20a_page_allocator_init(struct gk20a *g, struct gk20a_allocator *__a,
870 const char *name, u64 base, u64 length, 870 const char *name, u64 base, u64 length,
871 u64 blk_size, u64 flags) 871 u64 blk_size, u64 flags)
872{ 872{
873 struct gk20a_page_allocator *a; 873 struct gk20a_page_allocator *a;
874 char buddy_name[sizeof(__a->name)]; 874 char buddy_name[sizeof(__a->name)];
@@ -914,12 +914,12 @@ int gk20a_page_allocator_init(struct gk20a_allocator *__a,
914 914
915 snprintf(buddy_name, sizeof(buddy_name), "%s-src", name); 915 snprintf(buddy_name, sizeof(buddy_name), "%s-src", name);
916 916
917 err = gk20a_buddy_allocator_init(&a->source_allocator, buddy_name, base, 917 err = gk20a_buddy_allocator_init(g, &a->source_allocator, buddy_name,
918 length, blk_size, 0); 918 base, length, blk_size, 0);
919 if (err) 919 if (err)
920 goto fail; 920 goto fail;
921 921
922 gk20a_init_alloc_debug(__a); 922 gk20a_init_alloc_debug(g, __a);
923 palloc_dbg(a, "New allocator: type page\n"); 923 palloc_dbg(a, "New allocator: type page\n");
924 palloc_dbg(a, " base 0x%llx\n", a->base); 924 palloc_dbg(a, " base 0x%llx\n", a->base);
925 palloc_dbg(a, " size 0x%llx\n", a->length); 925 palloc_dbg(a, " size 0x%llx\n", a->length);
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 079e42ba..9906b77b 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -926,12 +926,12 @@ static int gk20a_init_vidmem(struct mm_gk20a *mm)
926 * initialization requires vidmem but we want to use the CE to zero 926 * initialization requires vidmem but we want to use the CE to zero
927 * out vidmem before allocating it... 927 * out vidmem before allocating it...
928 */ 928 */
929 err = gk20a_page_allocator_init(&g->mm.vidmem.bootstrap_allocator, 929 err = gk20a_page_allocator_init(g, &g->mm.vidmem.bootstrap_allocator,
930 "vidmem-bootstrap", 930 "vidmem-bootstrap",
931 bootstrap_base, bootstrap_size, 931 bootstrap_base, bootstrap_size,
932 SZ_4K, 0); 932 SZ_4K, 0);
933 933
934 err = gk20a_page_allocator_init(&g->mm.vidmem.allocator, 934 err = gk20a_page_allocator_init(g, &g->mm.vidmem.allocator,
935 "vidmem", 935 "vidmem",
936 base, size - base, 936 base, size - base,
937 default_page_size, 937 default_page_size,
@@ -4336,7 +4336,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
4336 snprintf(alloc_name, sizeof(alloc_name), 4336 snprintf(alloc_name, sizeof(alloc_name),
4337 "gk20a_%s-fixed", name); 4337 "gk20a_%s-fixed", name);
4338 4338
4339 err = __gk20a_buddy_allocator_init(&vm->fixed, 4339 err = __gk20a_buddy_allocator_init(g, &vm->fixed,
4340 vm, alloc_name, 4340 vm, alloc_name,
4341 small_vma_start, 4341 small_vma_start,
4342 g->separate_fixed_allocs, 4342 g->separate_fixed_allocs,
@@ -4354,6 +4354,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
4354 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s-%dKB", name, 4354 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s-%dKB", name,
4355 vm->gmmu_page_sizes[gmmu_page_size_small] >> 10); 4355 vm->gmmu_page_sizes[gmmu_page_size_small] >> 10);
4356 err = __gk20a_buddy_allocator_init( 4356 err = __gk20a_buddy_allocator_init(
4357 g,
4357 &vm->vma[gmmu_page_size_small], 4358 &vm->vma[gmmu_page_size_small],
4358 vm, alloc_name, 4359 vm, alloc_name,
4359 small_vma_start, 4360 small_vma_start,
@@ -4369,6 +4370,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
4369 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s-%dKB", 4370 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s-%dKB",
4370 name, vm->gmmu_page_sizes[gmmu_page_size_big] >> 10); 4371 name, vm->gmmu_page_sizes[gmmu_page_size_big] >> 10);
4371 err = __gk20a_buddy_allocator_init( 4372 err = __gk20a_buddy_allocator_init(
4373 g,
4372 &vm->vma[gmmu_page_size_big], 4374 &vm->vma[gmmu_page_size_big],
4373 vm, alloc_name, 4375 vm, alloc_name,
4374 large_vma_start, 4376 large_vma_start,
@@ -4385,7 +4387,7 @@ int gk20a_init_vm(struct mm_gk20a *mm,
4385 /* 4387 /*
4386 * kernel reserved VMA is at the end of the aperture 4388 * kernel reserved VMA is at the end of the aperture
4387 */ 4389 */
4388 err = __gk20a_buddy_allocator_init(&vm->vma[gmmu_page_size_kernel], 4390 err = __gk20a_buddy_allocator_init(g, &vm->vma[gmmu_page_size_kernel],
4389 vm, alloc_name, 4391 vm, alloc_name,
4390 kernel_vma_start, 4392 kernel_vma_start,
4391 kernel_vma_limit - kernel_vma_start, 4393 kernel_vma_limit - kernel_vma_start,
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 0a9a1fde..cd4bab76 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -3651,7 +3651,7 @@ static int pmu_process_init_msg(struct pmu_gk20a *pmu,
3651 pv->get_pmu_init_msg_pmu_sw_mg_size(init)) & 3651 pv->get_pmu_init_msg_pmu_sw_mg_size(init)) &
3652 ~(PMU_DMEM_ALLOC_ALIGNMENT - 1); 3652 ~(PMU_DMEM_ALLOC_ALIGNMENT - 1);
3653 u32 size = end - start; 3653 u32 size = end - start;
3654 gk20a_bitmap_allocator_init(&pmu->dmem, "gk20a_pmu_dmem", 3654 gk20a_bitmap_allocator_init(g, &pmu->dmem, "gk20a_pmu_dmem",
3655 start, size, 3655 start, size,
3656 PMU_DMEM_ALLOC_ALIGNMENT, 0); 3656 PMU_DMEM_ALLOC_ALIGNMENT, 0);
3657 } 3657 }
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index b256598f..9a305fd5 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -371,6 +371,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
371 gmmu_page_sizes[gmmu_page_size_small] >> 10); 371 gmmu_page_sizes[gmmu_page_size_small] >> 10);
372 372
373 err = __gk20a_buddy_allocator_init( 373 err = __gk20a_buddy_allocator_init(
374 g,
374 &vm->vma[gmmu_page_size_small], 375 &vm->vma[gmmu_page_size_small],
375 vm, name, 376 vm, name,
376 small_vma_start, 377 small_vma_start,
@@ -386,6 +387,7 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
386 snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id, 387 snprintf(name, sizeof(name), "gk20a_as_%d-%dKB", as_share->id,
387 gmmu_page_sizes[gmmu_page_size_big] >> 10); 388 gmmu_page_sizes[gmmu_page_size_big] >> 10);
388 err = __gk20a_buddy_allocator_init( 389 err = __gk20a_buddy_allocator_init(
390 g,
389 &vm->vma[gmmu_page_size_big], 391 &vm->vma[gmmu_page_size_big],
390 vm, name, 392 vm, name,
391 large_vma_start, 393 large_vma_start,
@@ -402,7 +404,9 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
402 /* 404 /*
403 * kernel reserved VMA is at the end of the aperture 405 * kernel reserved VMA is at the end of the aperture
404 */ 406 */
405 err = __gk20a_buddy_allocator_init(&vm->vma[gmmu_page_size_kernel], 407 err = __gk20a_buddy_allocator_init(
408 g,
409 &vm->vma[gmmu_page_size_kernel],
406 vm, name, 410 vm, name,
407 kernel_vma_start, 411 kernel_vma_start,
408 kernel_vma_limit - kernel_vma_start, 412 kernel_vma_limit - kernel_vma_start,