drm/amdgpu: read sdma edc counter to clear the counters
authorHawking Zhang <Hawking.Zhang@amd.com>
Wed, 8 Jan 2020 15:28:05 +0000 (23:28 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Jan 2020 15:18:08 +0000 (10:18 -0500)
commit5e62db9df684673f4ce7187c3c02e6a995c5cde9
tree009fc4488581d46065bec241dec967689d3a03e4
parent1dd5ead2940903b2cf36f6725f1d6670abd6f14b
drm/amdgpu: read sdma edc counter to clear the counters

SDMA edc counter registers were added in gfx edc counters
array. When querying gfx error counter in that array, there
is no way to differentiate sdma instance number for different
asic and then results to NULL pointer access when trying to
read sdma register base address for instances greater
than 2 on Vega20.
In addition, this also results to wrong gfx error counters
since it actually added sdma edc counters.
Therefore, sdma edc counter registers should be separated
from gfx edc counter regsiter array and only get initialized
when driver tries to enable sdma ras.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c