gpu: nvgpu: pci power management for iGPU-PCIe devices

Use the PCI power management functions for iGPU-PCIe devices.

JIRA NVGPU-9896

Change-Id: I1ac4ae67fa727e0a8e37ed2037d1417c5c19bb17
Signed-off-by: Ramalingam C <ramalingamc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2886799
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ramalingam C
2023-04-12 08:58:08 +00:00
committed by mobile promotions
parent 24bebfabaf
commit 24475ad46b

View File

@@ -700,11 +700,6 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
if (IS_ERR(platform->reset_control)) if (IS_ERR(platform->reset_control))
platform->reset_control = NULL; platform->reset_control = NULL;
#endif #endif
err = gk20a_pm_init(&pdev->dev);
if (err) {
dev_err(&pdev->dev, "pm init failed");
goto err_free_irq;
}
} }
if (strchr(dev_name(&pdev->dev), '%')) { if (strchr(dev_name(&pdev->dev), '%')) {
@@ -717,12 +712,10 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
if (err) if (err)
goto err_free_irq; goto err_free_irq;
if (!g->is_pci_igpu) { err = nvgpu_pci_pm_init(&pdev->dev);
err = nvgpu_pci_pm_init(&pdev->dev); if (err) {
if (err) { nvgpu_err(g, "pm init failed");
nvgpu_err(g, "pm init failed"); goto err_free_irq;
goto err_free_irq;
}
} }
if (!platform->disable_nvlink) { if (!platform->disable_nvlink) {
@@ -754,12 +747,6 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
#endif #endif
if (g->is_pci_igpu) { if (g->is_pci_igpu) {
err = gk20a_pm_late_init(&pdev->dev);
if (err) {
dev_err(&pdev->dev, "pm late_init failed");
goto err_free_irq;
}
l->nvgpu_reboot_nb.notifier_call = l->nvgpu_reboot_nb.notifier_call =
nvgpu_kernel_shutdown_notification; nvgpu_kernel_shutdown_notification;
err = register_reboot_notifier(&l->nvgpu_reboot_nb); err = register_reboot_notifier(&l->nvgpu_reboot_nb);
@@ -769,13 +756,14 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
err = nvgpu_get_dt_clock_limit(g, &g->dgpu_max_clk); err = nvgpu_get_dt_clock_limit(g, &g->dgpu_max_clk);
if (err != 0) if (err != 0)
nvgpu_info(g, "Missing nvgpu node"); nvgpu_info(g, "Missing nvgpu node");
err = nvgpu_pci_add_pci_power(pdev);
if (err) {
nvgpu_err(g, "add pci power failed (%d).", err);
goto err_free_irq;
}
} }
err = nvgpu_pci_add_pci_power(pdev);
if (err) {
nvgpu_err(g, "add pci power failed (%d).", err);
goto err_free_irq;
}
nvgpu_mutex_init(&l->dmabuf_priv_list_lock); nvgpu_mutex_init(&l->dmabuf_priv_list_lock);
nvgpu_init_list_node(&l->dmabuf_priv_list); nvgpu_init_list_node(&l->dmabuf_priv_list);