]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/ras: Fix the error of undefined reference to `__udivdi3'
authorYiPeng Chai <YiPeng.Chai@amd.com>
Tue, 28 Oct 2025 08:34:34 +0000 (16:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Nov 2025 16:51:30 +0000 (11:51 -0500)
Fix the error:
drivers/gpu/drm/amd/amdgpu/../ras/ras_mgr/amdgpu_ras_mgr.c:132:undefined reference to `__udivdi3'

Fixes: fa0b203cd902 ("drm/amd/ras: Add amdgpu ras management function.")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202510272144.6SUHUoWx-lkp@intel.com/
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c

index 8007e49951d8161ec20337a8b298c2d33d82df80..dc2a4c6c19074ce80a3cd001bcd5bac9e05d18c1 100644 (file)
@@ -37,7 +37,7 @@
 #define MAX_XCD_NUM_PER_AID                    2
 
 /* typical ECC bad page rate is 1 bad page per 100MB VRAM */
-#define ESTIMATE_BAD_PAGE_THRESHOLD(size)         ((size)/(100 * 1024 * 1024ULL))
+#define TYPICAL_ECC_BAD_PAGE_RATE (100ULL * SZ_1M)
 
 #define COUNT_BAD_PAGE_THRESHOLD(size) (((size) >> 21) << 4)
 
@@ -129,7 +129,7 @@ static int amdgpu_ras_mgr_init_eeprom_config(struct amdgpu_device *adev,
         */
        if (amdgpu_bad_page_threshold == NONSTOP_OVER_THRESHOLD)
                eeprom_cfg->eeprom_record_threshold_count =
-                               ESTIMATE_BAD_PAGE_THRESHOLD(adev->gmc.mc_vram_size);
+                       div64_u64(adev->gmc.mc_vram_size, TYPICAL_ECC_BAD_PAGE_RATE);
        else if (amdgpu_bad_page_threshold == WARN_NONSTOP_OVER_THRESHOLD)
                eeprom_cfg->eeprom_record_threshold_count =
                                COUNT_BAD_PAGE_THRESHOLD(RAS_RESERVED_VRAM_SIZE_DEFAULT);