mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: vgpu: init vars in gk20a vgpu missed
pending_sema_waits and a few other variables in struct gk20a is used in gk20a shutdown path but we didn't initialize them in vgpu. I added a function vgpu_init_vars dedicated to init variables for struct gk20a. The native code also similar function nvgpu_init_vars(). This is a quick fix. Finally, the common probe code is better be put in common function btween vgpu and native gpu. Bug 200293437 Jira EVLR-1152 Change-Id: I55f0d179d7adba556e0cb404766e14405b3e27e5 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: http://git-master/r/1330229 (cherry picked from commit 7691902fec8abdd621ee17561607efeef615499f) Reviewed-on: http://git-master/r/1331604 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
50667e097b
commit
71fc782914
@@ -227,6 +227,16 @@ static void vgpu_remove_support(struct gk20a *g)
|
||||
}
|
||||
}
|
||||
|
||||
static void vgpu_init_vars(struct gk20a *g)
|
||||
{
|
||||
nvgpu_mutex_init(&g->poweroff_lock);
|
||||
g->regs_saved = g->regs;
|
||||
g->bar1_saved = g->bar1;
|
||||
|
||||
INIT_LIST_HEAD(&g->pending_sema_waits);
|
||||
nvgpu_raw_spinlock_init(&g->pending_sema_waits_lock);
|
||||
}
|
||||
|
||||
static int vgpu_init_support(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
@@ -583,6 +593,8 @@ int vgpu_probe(struct platform_device *pdev)
|
||||
|
||||
vgpu_init_support(pdev);
|
||||
|
||||
vgpu_init_vars(gk20a);
|
||||
|
||||
init_rwsem(&gk20a->busy_lock);
|
||||
|
||||
nvgpu_spinlock_init(&gk20a->mc_enable_lock);
|
||||
|
||||
Reference in New Issue
Block a user