summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 796507a9..5012d8b5 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -59,6 +59,7 @@
59#include "cde_gp10b.h" 59#include "cde_gp10b.h"
60#include "ctxsw_trace.h" 60#include "ctxsw_trace.h"
61#include "driver_common.h" 61#include "driver_common.h"
62#include "channel.h"
62 63
63#define CLASS_NAME "nvidia-gpu" 64#define CLASS_NAME "nvidia-gpu"
64/* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */ 65/* TODO: Change to e.g. "nvidia-gpu%s" once we have symlinks in place. */
@@ -185,6 +186,25 @@ static int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l)
185 return 0; 186 return 0;
186} 187}
187 188
189static int nvgpu_finalize_poweron_linux(struct nvgpu_os_linux *l)
190{
191 struct gk20a *g = &l->g;
192 int err;
193
194 if (l->init_done)
195 return 0;
196
197 err = nvgpu_init_channel_support_linux(l);
198 if (err) {
199 nvgpu_err(g, "failed to init linux channel support");
200 return err;
201 }
202
203 l->init_done = true;
204
205 return 0;
206}
207
188int gk20a_pm_finalize_poweron(struct device *dev) 208int gk20a_pm_finalize_poweron(struct device *dev)
189{ 209{
190 struct gk20a *g = get_gk20a(dev); 210 struct gk20a *g = get_gk20a(dev);
@@ -227,6 +247,10 @@ int gk20a_pm_finalize_poweron(struct device *dev)
227 if (err) 247 if (err)
228 goto done; 248 goto done;
229 249
250 err = nvgpu_finalize_poweron_linux(l);
251 if (err)
252 goto done;
253
230 trace_gk20a_finalize_poweron_done(dev_name(dev)); 254 trace_gk20a_finalize_poweron_done(dev_name(dev));
231 255
232 err = nvgpu_init_os_linux_ops(l); 256 err = nvgpu_init_os_linux_ops(l);
@@ -596,6 +620,8 @@ void gk20a_remove_support(struct gk20a *g)
596 620
597 nvgpu_kfree(g, g->dbg_regops_tmp_buf); 621 nvgpu_kfree(g, g->dbg_regops_tmp_buf);
598 622
623 nvgpu_remove_channel_support_linux(l);
624
599 if (g->pmu.remove_support) 625 if (g->pmu.remove_support)
600 g->pmu.remove_support(&g->pmu); 626 g->pmu.remove_support(&g->pmu);
601 627