drm/amdgpu: Fix driver reloading failure
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix driver reloading failure
SRIOV doesn't implement PMC capability of PCIe, so it can't update power state by reading PMC register.
Currently, amdgpu driver doesn't disable pci device when removing driver, the enable_cnt of pci device will not be decrease to 0. When reloading driver, pci_enable_device will do nothing as enable_cnt is not zero. And power state will not be updated as PMC is not support.
So current_state of pci device is not D0 state and pci_enable_msi return fail.
Add pci_disable_device when remmoving driver to fix the issue.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
@@ -613,6 +613,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)drm_dev_unregister (dev);drm_dev_unref (dev); +pci_disable_device (pdev); +pci_set_drvdata (pdev,NULL ); } static void
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1505964136-2418-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Acked-by Alex DeucherQuoted 19 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Xiangliang.Yu
Sent: Wednesday, September 20, 2017 11:22 PM
To: [email protected]
Cc: Yu, Xiangliang
Subject: [PATCH] drm/amdgpu: Fix driver reloading failureSRIOV doesn't implement PMC capability of PCIe, so it can't update power state by reading PMC register.
Currently, amdgpu driver doesn't disable pci device when removing driver, the
enable_cntof pci device will not be decrease to 0. When reloading driver,pci_enable_devicewill do nothing asenable_cntis not zero. And power state will not be updated as PMC is not support.
Socurrent_stateof pci device is not D0 state andpci_enable_msireturn fail.
Quoted 3 lines
Add
pci_disable_devicewhen remmoving driver to fix the issue.Signed-off-by Xiangliang.Yu <[email protected]>
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1@@ -613,6 +613,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)drm_dev_unregister (dev);drm_dev_unref (dev); +pci_disable_device (pdev); +pci_set_drvdata (pdev,NULL ); } static void --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx