drm/amdgpu: Restore msix after FLR
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: Restore msix after FLR
From: "Emily.Deng" <[email protected]>
After FLR, the msix will be cleared, so need to re-enable it.
Signed-off-by Emily.Deng <[email protected]>
Signed-off-by Peng Ju Zhou <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +13 -0
@@ -277,6 +277,18 @@ static bool amdgpu_msi_ok(struct amdgpu_device *adev)return true; } +void amdgpu_restore_msix (struct amdgpu_device *adev) +{ +#ifdef PCI_IRQ_MSIX +u16 ctrl; + +pci_read_config_word (adev->pdev, adev->pdev->msix_cap +PCI_MSIX_FLAGS , &ctrl); + ctrl &= ~PCI_MSIX_FLAGS_ENABLE ; +pci_write_config_word (adev->pdev, adev->pdev->msix_cap +PCI_MSIX_FLAGS , ctrl); + ctrl |=PCI_MSIX_FLAGS_ENABLE ; +pci_write_config_word (adev->pdev, adev->pdev->msix_cap +PCI_MSIX_FLAGS , ctrl); +#endif +}/** * amdgpu_irq_init - initialize interrupt handling *
@@ -558,6 +570,7 @@ void amdgpu_irq_gpu_reset_resume_helper(struct amdgpu_device *adev) {int i, j, k; +amdgpu_restore_msix (adev);for (i =0 ; i <AMDGPU_IRQ_CLIENTID_MAX ; ++i) {if (!adev->irq.client[i].sources)continue ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 24.06.21 um 07:31 schrieb Peng Ju Zhou:
Quoted 15 lines
From: "Emily.Deng" <[email protected]>
After FLR, the msix will be cleared, so need to re-enable it.
Signed-off-by Emily.Deng <[email protected]>Signed-off-by Peng Ju Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c static bool amdgpu_msi_ok(struct amdgpu_device *adev) · line 282
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +3
-0@@ -277,6 +277,18 @@ static bool amdgpu_msi_ok(struct amdgpu_device *adev)return true; } +void amdgpu_restore_msix (struct amdgpu_device *adev) +{ +#ifdef PCI_IRQ_MSIX
Please drop that ifdef, the macro is always defined upstream.
Christian.
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +9
-0+u16 ctrl; + +pci_read_config_word (adev->pdev, adev->pdev->msix_cap +PCI_MSIX_FLAGS , &ctrl); + ctrl &= ~PCI_MSIX_FLAGS_ENABLE ; +pci_write_config_word (adev->pdev, adev->pdev->msix_cap +PCI_MSIX_FLAGS , ctrl); + ctrl |=PCI_MSIX_FLAGS_ENABLE ; +pci_write_config_word (adev->pdev, adev->pdev->msix_cap +PCI_MSIX_FLAGS , ctrl); +#endif +}/** * amdgpu_irq_init - initialize interrupt handling *
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c void amdgpu_irq_gpu_reset_resume_helper(struct amdgpu_device *adev) · line 576
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +1
-0@@ -558,6 +570,7 @@ void amdgpu_irq_gpu_reset_resume_helper(struct amdgpu_device *adev) {int i, j, k; +amdgpu_restore_msix (adev);for (i =0 ; i <AMDGPU_IRQ_CLIENTID_MAX ; ++i) {if (!adev->irq.client[i].sources)continue ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx