[PATCH 5/7] drm/amdgpu: don't disable MSI for GPU virtual function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: pding <Pixel.Ding@xxxxxxx>

After calling pci_disable_msi() and pci_enable_msi(), VF can't
receive interrupt anymore. This may introduce problems in module
reloading or retrying init.

Signed-off-by: pding <Pixel.Ding at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index c2d8255..a3314b5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -229,8 +229,7 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
 	adev->irq.msi_enabled = false;
 
 	if (amdgpu_msi_ok(adev)) {
-		int ret = pci_enable_msi(adev->pdev);
-		if (!ret) {
+		if (adev->pdev->msi_enabled || !pci_enable_msi(adev->pdev)) {
 			adev->irq.msi_enabled = true;
 			INIT_DEV_INFO(adev->dev, "amdgpu: using MSI.\n");
 		}
@@ -280,7 +279,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
 	if (adev->irq.installed) {
 		drm_irq_uninstall(adev->ddev);
 		adev->irq.installed = false;
-		if (adev->irq.msi_enabled)
+		if (adev->irq.msi_enabled && !amdgpu_sriov_vf(adev))
 			pci_disable_msi(adev->pdev);
 		flush_work(&adev->hotplug_work);
 		cancel_work_sync(&adev->reset_work);
-- 
2.9.5



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux