Skip to contentSkip to conversation

drm/amdgpu: Fix eeprom max record count

PATCH In review Stanley.Yang 2 participants 4 messages Jul 18, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amdgpu: Fix eeprom max record count

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +3 -0
index eae0a555df3c..aab8077e5098 100644
@@ -1011,6 +1011,9 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
 
 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
Signature · 1 line
2.25.1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Can you please try moving amdgpu_ras_set_eeprom_table_version to the beginning of amdgpu_ras_recovery_init?

In such way, we don't need to invoke this function from both amdgpu_ras_eeprom_max_record_count and amdgpu_ras_eeprom_init

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Thursday, July 18, 2024 11:20
To: [email protected]
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review V2 1/1] drm/amdgpu: Fix eeprom max record count

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +3 -1
index eae0a555df3c..aab8077e5098 100644
@@ -1011,6 +1011,9 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
 
 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
--

2.25.1

#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Only set eeprom table version in the beginning of amdgpu_ras_recovery_init is not enough, because the table version value is set to zero read from device eeprom table in function amdgpu_ras_eeprom_init due to no available eeprom info in a new device that have never loaded driver before.

Regards,
Stanley

Quoted 56 lines

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Thursday, July 18, 2024 11:52 AM
To: Yang, Stanley <[email protected]>; [email protected]
Cc: Yang, Stanley <[email protected]>
Subject: RE: [PATCH Review V2 1/1] drm/amdgpu: Fix eeprom max record count

[AMD Official Use Only - AMD Internal Distribution Only]

Can you please try moving amdgpu_ras_set_eeprom_table_version to the beginning of amdgpu_ras_recovery_init?

In such way, we don't need to invoke this function from both amdgpu_ras_eeprom_max_record_count and amdgpu_ras_eeprom_init

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Thursday, July 18, 2024 11:20
To: [email protected]
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review V2 1/1] drm/amdgpu: Fix eeprom max record count

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +3 -0
index eae0a555df3c..aab8077e5098 100644
@@ -1011,6 +1011,9 @@ int amdgpu_ras_eeprom_read(struct
 amdgpu_ras_eeprom_control *control,
 
 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
--
2.25.1

Reviewed-by
#3 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Thanks for the clarification.

Regards,
Hawking
-----Original Message-----
From: Yang, Stanley <[email protected]>
Sent: Thursday, July 18, 2024 12:06
To: Zhang, Hawking <[email protected]>; [email protected]
Subject: RE: [PATCH Review V2 1/1] drm/amdgpu: Fix eeprom max record count

[AMD Official Use Only - AMD Internal Distribution Only]

Only set eeprom table version in the beginning of amdgpu_ras_recovery_init is not enough, because the table version value is set to zero read from device eeprom table in function amdgpu_ras_eeprom_init due to no available eeprom info in a new device that have never loaded driver before.

Regards,
Stanley

Quoted 58 lines

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Thursday, July 18, 2024 11:52 AM
To: Yang, Stanley <[email protected]>; [email protected]
Cc: Yang, Stanley <[email protected]>
Subject: RE: [PATCH Review V2 1/1] drm/amdgpu: Fix eeprom max record count

[AMD Official Use Only - AMD Internal Distribution Only]

Can you please try moving amdgpu_ras_set_eeprom_table_version to the beginning of amdgpu_ras_recovery_init?

In such way, we don't need to invoke this function from both amdgpu_ras_eeprom_max_record_count and amdgpu_ras_eeprom_init

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Thursday, July 18, 2024 11:20
To: [email protected]
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review V2 1/1] drm/amdgpu: Fix eeprom max record count

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +3 -0
index eae0a555df3c..aab8077e5098 100644
@@ -1011,6 +1011,9 @@ int amdgpu_ras_eeprom_read(struct
 amdgpu_ras_eeprom_control *control,
 
 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
--
2.25.1