diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index b103fcea4..59691c64b 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c @@ -246,6 +246,10 @@ int gk20a_pm_finalize_poweron(struct device *dev) INIT_WORK(&l->nonstall_fn_work, nvgpu_intr_nonstall_cb); } + err = gk20a_detect_chip(g); + if (err) + return err; + err = gk20a_finalize_poweron(g); set_user_nice(current, nice_value); if (err) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index c2daf27e4..0206c915d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -68,7 +68,7 @@ void __gk20a_warn_on_no_regs(void) WARN_ONCE(1, "Attempted access to GPU regs after unmapping!"); } -static int gk20a_detect_chip(struct gk20a *g) +int gk20a_detect_chip(struct gk20a *g) { struct nvgpu_gpu_params *p = &g->params; @@ -131,10 +131,6 @@ int gk20a_finalize_poweron(struct gk20a *g) g->power_on = true; - err = gk20a_detect_chip(g); - if (err) - goto done; - /* * Before probing the GPU make sure the GPU's state is cleared. This is * relevant for rebind operations. diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 5de2b4399..2786340ea 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1549,4 +1549,5 @@ static inline bool gk20a_platform_has_syncpoints(struct gk20a *g) #endif } +int gk20a_detect_chip(struct gk20a *g); #endif /* GK20A_H */