drm/amdgpu: move amdgpu_virt_release_full_gpu to fini_early stage
Subsystems (2)
PATCH 1/1 drm/amdgpu: move amdgpu_virt_release_full_gpu to fini_early stage
adev->rmmio is set to be NULL in amdgpu_device_unmap_mmio to prevent access after pci_remove, however, in SRIOV case, amdgpu_virt_release_full_gpu will still use adev->rmmio for access after amdgpu_device_unmap_mmio. The patch is to move such SRIOV calling earlier to fini_early stage.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -4
@@ -2810,6 +2810,11 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = false; } +if (amdgpu_sriov_vf (adev)) { +if (amdgpu_virt_release_full_gpu (adev, false)) +DRM_ERROR ("failed to release exclusive mode on fini\n" ); + } +return 0 ; }
@@ -2870,10 +2875,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)amdgpu_ras_fini (adev); -if (amdgpu_sriov_vf (adev)) -if (amdgpu_virt_release_full_gpu (adev, false)) -DRM_ERROR ("failed to release exclusive mode on fini\n" ); -return 0 ; }
Signature · 1 line
2.17.1
[Public]
Ping...
Regards,
Guchun
-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Saturday, September 18, 2021 2:09 PM
To: [email protected]; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; Deucher, Alexander <[email protected]>; Grodzovsky, Andrey <[email protected]>; Liu, Monk <[email protected]>
Cc: Chen, Guchun <[email protected]>; Shi, Leslie <[email protected]>
Subject: [PATCH] drm/amdgpu: move amdgpu_virt_release_full_gpu to fini_early stage
adev->rmmio is set to be NULL in amdgpu_device_unmap_mmio to prevent
access after pci_remove, however, in SRIOV case, amdgpu_virt_release_full_gpu will still use adev->rmmio for access after amdgpu_device_unmap_mmio. The patch is to move such SRIOV calling earlier to fini_early stage.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -4
@@ -2810,6 +2810,11 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = false; } +if (amdgpu_sriov_vf (adev)) { +if (amdgpu_virt_release_full_gpu (adev, false)) +DRM_ERROR ("failed to release exclusive mode on fini\n" ); + } +return 0 ; }
@@ -2870,10 +2875,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)amdgpu_ras_fini (adev); -if (amdgpu_sriov_vf (adev)) -if (amdgpu_virt_release_full_gpu (adev, false)) -DRM_ERROR ("failed to release exclusive mode on fini\n" ); -return 0 ; }
--
2.17.1
Andrey Grodzovsky
Reviewed-byAndrey
Quoted 55 lines · Guchun
[Public]
Ping...
Regards,
Guchun-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Saturday, September 18, 2021 2:09 PM
To: [email protected]; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; Deucher, Alexander <[email protected]>; Grodzovsky, Andrey <[email protected]>; Liu, Monk <[email protected]>
Cc: Chen, Guchun <[email protected]>; Shi, Leslie <[email protected]>
Subject: [PATCH] drm/amdgpu: moveamdgpu_virt_release_full_gputofini_earlystage
adev->rmmiois set to be NULL inamdgpu_device_unmap_mmioto prevent
access afterpci_remove, however, in SRIOV case,amdgpu_virt_release_full_gpuwill still useadev->rmmiofor access afteramdgpu_device_unmap_mmio. The patch is to move such SRIOV calling earlier tofini_earlystage.Fixes 07775fc13878("drm/amdgpu: Unmap all MMIO mappings")Cc Andrey Grodzovsky <[email protected]>Signed-off-by Leslie Shi <[email protected]>Signed-off-by Guchun Chen <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5
-5@@ -2810,6 +2810,11 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = false; } +if (amdgpu_sriov_vf (adev)) { +if (amdgpu_virt_release_full_gpu (adev, false)) +DRM_ERROR ("failed to release exclusive mode on fini\n" ); + } +return 0 ; }@@ -2870,10 +2875,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)amdgpu_ras_fini (adev); -if (amdgpu_sriov_vf (adev)) -if (amdgpu_virt_release_full_gpu (adev, false)) -DRM_ERROR ("failed to release exclusive mode on fini\n" ); -return 0 ; } --2.17.1