]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: increase RAS bad page threshold
authorTao Zhou <tao.zhou1@amd.com>
Thu, 6 Mar 2025 03:36:49 +0000 (11:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:52 +0000 (11:12 +0200)
[ Upstream commit 334dc5fcc3f177823115ec4e075259997c16d4a7 ]

For default policy, driver will issue an RMA event when the number of
bad pages is greater than 8 physical rows, rather than reaches 8
physical rows, don't rely on threshold configurable parameters in
default mode.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c

index 52c16bfeccaad88330489283d2c7792e902554aa..12ffe4a963d317ec43481f0b90a6c2759a293943 100644 (file)
@@ -748,7 +748,7 @@ amdgpu_ras_eeprom_update_header(struct amdgpu_ras_eeprom_control *control)
        /* Modify the header if it exceeds.
         */
        if (amdgpu_bad_page_threshold != 0 &&
-           control->ras_num_bad_pages >= ras->bad_page_cnt_threshold) {
+           control->ras_num_bad_pages > ras->bad_page_cnt_threshold) {
                dev_warn(adev->dev,
                        "Saved bad pages %d reaches threshold value %d\n",
                        control->ras_num_bad_pages, ras->bad_page_cnt_threshold);
@@ -806,7 +806,7 @@ amdgpu_ras_eeprom_update_header(struct amdgpu_ras_eeprom_control *control)
         */
        if (amdgpu_bad_page_threshold != 0 &&
            control->tbl_hdr.version == RAS_TABLE_VER_V2_1 &&
-           control->ras_num_bad_pages < ras->bad_page_cnt_threshold)
+           control->ras_num_bad_pages <= ras->bad_page_cnt_threshold)
                control->tbl_rai.health_percent = ((ras->bad_page_cnt_threshold -
                                                   control->ras_num_bad_pages) * 100) /
                                                   ras->bad_page_cnt_threshold;
@@ -1451,7 +1451,7 @@ int amdgpu_ras_eeprom_check(struct amdgpu_ras_eeprom_control *control)
                                  res);
                        return -EINVAL;
                }
-               if (ras->bad_page_cnt_threshold > control->ras_num_bad_pages) {
+               if (ras->bad_page_cnt_threshold >= control->ras_num_bad_pages) {
                        /* This means that, the threshold was increased since
                         * the last time the system was booted, and now,
                         * ras->bad_page_cnt_threshold - control->num_recs > 0,