diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/pd_cache.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/pd_cache.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/pd_cache.c b/drivers/gpu/nvgpu/common/mm/pd_cache.c index 335ef360..77e20c38 100644 --- a/drivers/gpu/nvgpu/common/mm/pd_cache.c +++ b/drivers/gpu/nvgpu/common/mm/pd_cache.c | |||
@@ -90,6 +90,8 @@ int nvgpu_pd_cache_init(struct gk20a *g) | |||
90 | { | 90 | { |
91 | struct nvgpu_pd_cache *cache; | 91 | struct nvgpu_pd_cache *cache; |
92 | u32 i; | 92 | u32 i; |
93 | int err = 0; | ||
94 | |||
93 | 95 | ||
94 | /* | 96 | /* |
95 | * This gets called from finalize_poweron() so we need to make sure we | 97 | * This gets called from finalize_poweron() so we need to make sure we |
@@ -111,9 +113,15 @@ int nvgpu_pd_cache_init(struct gk20a *g) | |||
111 | } | 113 | } |
112 | 114 | ||
113 | cache->mem_tree = NULL; | 115 | cache->mem_tree = NULL; |
114 | g->mm.pd_cache = cache; | ||
115 | nvgpu_mutex_init(&cache->lock); | ||
116 | 116 | ||
117 | err = nvgpu_mutex_init(&cache->lock); | ||
118 | if (err != 0) { | ||
119 | nvgpu_err(g, "Error in cache.lock initialization"); | ||
120 | nvgpu_kfree(g, cache); | ||
121 | return err; | ||
122 | } | ||
123 | |||
124 | g->mm.pd_cache = cache; | ||
117 | pd_dbg(g, "PD cache initialized!"); | 125 | pd_dbg(g, "PD cache initialized!"); |
118 | 126 | ||
119 | return 0; | 127 | return 0; |