]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: Add ras module eeprom safety watermark check
authorYiPeng Chai <YiPeng.Chai@amd.com>
Wed, 26 Mar 2025 10:03:49 +0000 (18:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 20 Oct 2025 22:19:02 +0000 (18:19 -0400)
Add ras module eeprom safety watermark check.

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

index 3eb3fb55ccb05a4194355657cf7345945c4bf5d7..5a7bf0661dbfbec0580a0a34812f5a7aedd53bc7 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/uaccess.h>
 
 #include "amdgpu_reset.h"
+#include "amdgpu_ras_mgr.h"
 
 /* These are memory addresses as would be seen by one or more EEPROM
  * chips strung on the I2C bus, usually by manipulating pins 1-3 of a
@@ -556,6 +557,9 @@ bool amdgpu_ras_eeprom_check_err_threshold(struct amdgpu_device *adev)
 {
        struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
 
+       if (amdgpu_uniras_enabled(adev))
+               return amdgpu_ras_mgr_check_eeprom_safety_watermark(adev);
+
        if (!__is_ras_eeprom_supported(adev) ||
            !amdgpu_bad_page_threshold)
                return false;