gpu: nvgpu: Add powernode support to vgpu

As the normal gpu is powered on by writing one to
power-node, the patch is adding power node for vgpu.

Change-Id: I08fbbe8694e02c826a0d5692f5a4c0f4efd396ff
Signed-off-by: dt <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2537053
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
dt
2021-05-30 20:25:37 +00:00
committed by mobile promotions
parent ac30c4cb65
commit 5e82717c96

View File

@@ -216,6 +216,15 @@ int vgpu_pm_finalize_poweron(struct device *dev)
if (err) if (err)
goto done; goto done;
if (!l->dev_nodes_created) {
err = gk20a_user_init(dev);
if (err) {
goto done;
}
l->dev_nodes_created = true;
}
/* Initialize linux specific flags */ /* Initialize linux specific flags */
gk20a_init_linux_characteristics(g); gk20a_init_linux_characteristics(g);
@@ -372,10 +381,6 @@ int vgpu_probe(struct platform_device *pdev)
platform->g = gk20a; platform->g = gk20a;
platform->vgpu_priv = priv; platform->vgpu_priv = priv;
err = gk20a_user_init(dev);
if (err)
return err;
err = vgpu_init_support(pdev); err = vgpu_init_support(pdev);
if (err != 0) { if (err != 0) {
kfree(l); kfree(l);
@@ -410,6 +415,12 @@ int vgpu_probe(struct platform_device *pdev)
} }
} }
err = gk20a_power_node_init(dev);
if (err) {
nvgpu_err(gk20a, "power_node creation failed");
return err;
}
err = vgpu_comm_init(gk20a); err = vgpu_comm_init(gk20a);
if (err) { if (err) {
nvgpu_err(gk20a, "failed to init comm interface"); nvgpu_err(gk20a, "failed to init comm interface");
@@ -462,7 +473,6 @@ int vgpu_probe(struct platform_device *pdev)
gk20a->timeouts_disabled_by_user = false; gk20a->timeouts_disabled_by_user = false;
nvgpu_atomic_set(&gk20a->timeouts_disabled_refcount, 0); nvgpu_atomic_set(&gk20a->timeouts_disabled_refcount, 0);
gk20a->tsg_dbg_timeslice_max_us = NVGPU_TSG_DBG_TIMESLICE_MAX_US_DEFAULT; gk20a->tsg_dbg_timeslice_max_us = NVGPU_TSG_DBG_TIMESLICE_MAX_US_DEFAULT;
vgpu_create_sysfs(dev); vgpu_create_sysfs(dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)