]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Return error if no RAS
authorLuben Tuikov <luben.tuikov@amd.com>
Fri, 2 Jul 2021 22:35:14 +0000 (18:35 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Jul 2021 15:48:10 +0000 (11:48 -0400)
commit75f2f6709d8706b85bdd1f6ad97165d605be5bd3
tree408f484af00b23b816f6fdaf3788d7b0f4fabd11
parentfe55d6294c753841e77cc8123bb8a9b7a9f71f1e
drm/amdgpu: Return error if no RAS

In amdgpu_ras_query_error_count() return an error
if the device doesn't support RAS. This prevents
that function from having to always set the values
of the integer pointers (if set), and thus
prevents function side effects--always to have to
set values of integers if integer pointers set,
regardless of whether RAS is supported or
not--with this change this side effect is
mitigated.

Also, if no pointers are set, don't count, since
we've no way of reporting the counts.

Also, give this function a kernel-doc.

Cc: Alexander Deucher <Alexander.Deucher@amd.com>
Cc: John Clements <john.clements@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Reported-by: Tom Rix <trix@redhat.com>
Fixes: f009bc6dc63e91 ("drm/amdgpu: Fix RAS function interface")
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Alexander Deucher <Alexander.Deucher@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