drm/amdgpu: timely save bad pages to eeprom after gpu ras reset is completed
authorYiPeng Chai <YiPeng.Chai@amd.com>
Tue, 2 Jul 2024 09:53:02 +0000 (17:53 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Jul 2024 14:13:41 +0000 (10:13 -0400)
commite23300dfffa178b19abc1b1b94ed7de74b0e0930
tree04539b69ce53af53923d6e4c4edb822179699c14
parentc04706914ddeb9098a509a5647c0b46c7e07cf11
drm/amdgpu: timely save bad pages to eeprom after gpu ras reset is completed

The problem case is as follows:
1. GPU A triggers a gpu ras reset, and GPU A drives
   GPU B to also perform a gpu ras reset.
2. After gpu B ras reset started, gpu B queried a DE
   data. Since the DE data was queried in the ras reset
   thread instead of the page retirement thread, bad
   page retirement work would not be triggered. Then
   even if all gpu resets are completed, the bad pages
   will be cached in RAM until GPU B's bad page retirement
   work is triggered again and then saved to eeprom.

This patch can save the bad pages to eeprom in time after gpu
ras reset is completed.

v2:
  1. Add the above description to code comments.
  2. Reuse existing function.

Signed-off-by: YiPeng Chai <YiPeng.Chai@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/umc_v12_0.c