drm/amdgpu: allow query error counters for specific IP block
authorHawking Zhang <Hawking.Zhang@amd.com>
Tue, 3 Jan 2023 15:41:10 +0000 (23:41 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Jan 2023 16:42:14 +0000 (11:42 -0500)
commit4a1c9a444b5e0f276f43f77e1723088bbedb1687
tree5dde22a6ca7ea9e6ced8a4a847c6727b09ed9ae9
parent90f56611fc5b54d55e94ded1d494d6090649bdb6
drm/amdgpu: allow query error counters for specific IP block

amdgpu_ras_block_late_init will be invoked in IP
specific ras_late_init call as a common helper for
all the IP blocks.

However, when amdgpu_ras_block_late_init call
amdgpu_ras_query_error_count to query ras error
counters, amdgpu_ras_query_error_count queries
all the IP blocks that support ras query interface.

This results to wrong error counters cached in
software copies when there are ras errors detected
at time zero or warm reset procedure. i.e., in
sdma_ras_late_init phase, it counts on sdma/mmhub
errors, while, in mmhub_ras_late_init phase, it
still counts on sdma/mmhub errors.

The change updates amdgpu_ras_query_error_count
interface to allow query specific ip error counter.
It introduces a new input parameter: query_info. if
query_info is NULL,  it means query all the IP blocks,
otherwise, only query the ip block specified by
query_info.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h