From 395c5538136049dcbc52ab218c3b5f764e7d0199 Mon Sep 17 00:00:00 2001 From: Aparna Das Date: Tue, 13 Feb 2018 07:52:52 -0800 Subject: gpu: nvgpu: move chip detect in os specific probe code This allows moving HAL overrides for vserver out of common chip specific HAL files into os specific probe code. Jira VQRM-3070 Change-Id: Icc61aacc03ac7db7a0ea1f6a2dd2b76185c74757 Signed-off-by: Aparna Das Reviewed-on: https://git-master.nvidia.com/r/1656752 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Richard Zhao Tested-by: Richard Zhao Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/module.c | 4 ++++ drivers/gpu/nvgpu/gk20a/gk20a.c | 6 +----- drivers/gpu/nvgpu/gk20a/gk20a.h | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index b103fcea..59691c64 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 c2daf27e..0206c915 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 5de2b439..2786340e 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 */ -- cgit v1.2.2