lkml.org 
[lkml]   [2020]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.5 33/41] drm/amdgpu: clean wptr on wb when gpu recovery
    Date
    From: Yintian Tao <yttao@amd.com>

    [ Upstream commit 2ab7e274b86739f4ceed5d94b6879f2d07b2802f ]

    The TDR will be randomly failed due to compute ring
    test failure. If the compute ring wptr & 0x7ff(ring_buf_mask)
    is 0x100 then after map mqd the compute ring rptr will be
    synced with 0x100. And the ring test packet size is also 0x100.
    Then after invocation of amdgpu_ring_commit, the cp will not
    really handle the packet on the ring buffer because rptr is equal to wptr.

    Signed-off-by: Yintian Tao <yttao@amd.com>
    Acked-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Monk Liu <Monk.Liu@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
    drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 +
    2 files changed, 2 insertions(+)

    diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
    index 6b5b243af15dc..1a80423b1d4f0 100644
    --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
    +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
    @@ -3496,6 +3496,7 @@ static int gfx_v10_0_kcq_init_queue(struct amdgpu_ring *ring)

    /* reset ring buffer */
    ring->wptr = 0;
    + atomic64_set((atomic64_t *)&adev->wb.wb[ring->wptr_offs], 0);
    amdgpu_ring_clear_ring(ring);
    } else {
    amdgpu_ring_clear_ring(ring);
    diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
    index 085b84322e928..67f30fec94df2 100644
    --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
    +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
    @@ -3538,6 +3538,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)

    /* reset ring buffer */
    ring->wptr = 0;
    + atomic64_set((atomic64_t *)&adev->wb.wb[ring->wptr_offs], 0);
    amdgpu_ring_clear_ring(ring);
    } else {
    amdgpu_ring_clear_ring(ring);
    --
    2.20.1
    \
     
     \ /
      Last update: 2020-03-16 03:41    [W:2.861 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site