[PATCH 15/22] drm/amdgpu: move WB_FREE to correct place
Alex Deucher
alexdeucher at gmail.com
Mon Feb 26 17:36:02 UTC 2018
On Mon, Feb 26, 2018 at 12:18 AM, Monk Liu <Monk.Liu at amd.com> wrote:
> 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.
>
> Change-Id: If721cfd06d8c3113929306378793713fd05fc929
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +++++++-----
> 1 file 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 f6380ed..730ff97 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1460,11 +1460,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
> for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
> if (!adev->ip_blocks[i].status.hw)
> continue;
> - if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
> - amdgpu_free_static_csa(adev);
> - amdgpu_device_wb_fini(adev);
> - amdgpu_device_vram_scratch_fini(adev);
> - }
>
> if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
> adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
> @@ -1495,6 +1490,13 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
> for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
> if (!adev->ip_blocks[i].status.sw)
> continue;
> +
> + if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
> + amdgpu_free_static_csa(adev);
> + amdgpu_device_wb_fini(adev);
> + amdgpu_device_vram_scratch_fini(adev);
> + }
> +
> r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev);
> /* XXX handle errors */
> if (r) {
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list