drm/amdgpu: Report ras_num_recs in debugfs
authorLuben Tuikov <luben.tuikov@amd.com>
Sat, 3 Jun 2023 04:08:04 +0000 (00:08 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Jun 2023 15:06:58 +0000 (11:06 -0400)
commit740f42a28f4cff9e009a17cc78666165ecca9293
tree0cc3984ff85cb53bbfac85f3c5913c3740f1117e
parent765663b7faaedf7750ff7e59c3ce5dc51fdd1fca
drm/amdgpu: Report ras_num_recs in debugfs

Report the number of records stored in the RAS EEPROM table in debugfs.

This can be used by user-space to calculate the capacity of the RAS EEPROM
table since "bad_page_cnt_threshold" is also reported in the same place in
debugfs.

See commit 7fb640714547 ("drm/amdgpu: Add bad_page_cnt_threshold to debugfs").

ras_num_recs can already be inferred by dumping the RAS EEPROM table, also in
the same debugfs location, see commit reference c65b0805e77919 (drm/amdgpu:
RAS EEPROM table is now in debugfs, 2021-04-08). This commit makes it an
integer value easily shown in a single file.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: Tao Zhou <tao.zhou1@amd.com>
Cc: Stanley Yang <Stanley.Yang@amd.com>
Cc: John Clements <john.clements@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Link: https://lore.kernel.org/r/20230603051043.211548-1-luben.tuikov@amd.com
Acked-by: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c