diff options
author | Monk Liu <Monk.Liu@amd.com> | 2018-01-23 23:20:32 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-28 14:18:04 -0500 |
commit | c12aba3acde52e2ae7807e4e263dfba34fcdbb0c (patch) | |
tree | 7edb624aca6608280f8bb4271f7ffe1844b41f54 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | ed9324afc0ec1ebe5dcef632eee6381f6ebf8fd5 (diff) |
drm/amdgpu: move WB_FREE to correct place
WB_FREE should be put after all engines's hw_fini
done, otherwise the invalid wptr/rptr_addr would still
be used by engines which trigger abnormal bugs.
This fixes couple DMAR reading error in host side for SRIOV
after guest kmd is unloaded.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 5b7443313231..41244858df64 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -1459,11 +1459,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) | |||
1459 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 1459 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
1460 | if (!adev->ip_blocks[i].status.hw) | 1460 | if (!adev->ip_blocks[i].status.hw) |
1461 | continue; | 1461 | continue; |
1462 | if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { | ||
1463 | amdgpu_free_static_csa(adev); | ||
1464 | amdgpu_device_wb_fini(adev); | ||
1465 | amdgpu_device_vram_scratch_fini(adev); | ||
1466 | } | ||
1467 | 1462 | ||
1468 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && | 1463 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
1469 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { | 1464 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { |
@@ -1493,6 +1488,13 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) | |||
1493 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 1488 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
1494 | if (!adev->ip_blocks[i].status.sw) | 1489 | if (!adev->ip_blocks[i].status.sw) |
1495 | continue; | 1490 | continue; |
1491 | |||
1492 | if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { | ||
1493 | amdgpu_free_static_csa(adev); | ||
1494 | amdgpu_device_wb_fini(adev); | ||
1495 | amdgpu_device_vram_scratch_fini(adev); | ||
1496 | } | ||
1497 | |||
1496 | r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); | 1498 | r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); |
1497 | /* XXX handle errors */ | 1499 | /* XXX handle errors */ |
1498 | if (r) { | 1500 | if (r) { |