]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/amdgpu: Fix eeprom max record count
authorStanley.Yang <Stanley.Yang@amd.com>
Thu, 18 Jul 2024 02:58:04 +0000 (10:58 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:45:45 +0000 (17:45 -0400)
The eeprom table is empty before initializing,
set eeprom table version first before initializing.

Changed from V1:
Reuse amdgpu_ras_set_eeprom_table_version function

Signed-off-by: Stanley.Yang <Stanley.Yang@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 eae0a555df3c482f4535ff6f45ed9f7d88845801..aab8077e50988ef08c3422de907b8bd9f48a3784 100644 (file)
@@ -1011,6 +1011,9 @@ Out:
 
 uint32_t amdgpu_ras_eeprom_max_record_count(struct amdgpu_ras_eeprom_control *control)
 {
+       /* get available eeprom table version first before eeprom table init */
+       amdgpu_ras_set_eeprom_table_version(control);
+
        if (control->tbl_hdr.version == RAS_TABLE_VER_V2_1)
                return RAS_MAX_RECORD_COUNT_V2_1;
        else