Skip to contentSkip to conversation

drm/amd/ras: ignore ras eeprom init errors

PATCH In review Tao Zhou 2 participants 2 messages Aug 10

Subsystems (2)
lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

PATCH 1/1 drm/amd/ras: ignore ras eeprom init errors

Even eeprom is not functional, other RAS functions can still work, no need to block the whole driver initialization.

---
 drivers/gpu/drm/amd/ras/core/core.c | 31 +++++++++++++----------------
 1 file changed, 14 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/ras/core/core.c +14 -17
index 9d24d3b48d74..6e5503f53bbf 100644
@@ -408,37 +408,34 @@ int ras_core_hw_init(struct ras_core_context *ras_core)
 		ret = ras_fw_eeprom_hw_init(ras_core);
 	else
 		ret = ras_eeprom_hw_init(ras_core);
-	if (ret)
-		goto init_err6;
 
-	ret = ras_core_eeprom_recovery(ras_core);
-	if (ret) {
-		RAS_DEV_ERR(ras_core->dev,
-			"Failed to recovery ras core, ret:%d\n", ret);
-		goto init_err6;
+	if (!ret) {
+		ret = ras_core_eeprom_recovery(ras_core);
+		if (ret)
+			RAS_DEV_ERR(ras_core->dev,
+				"Failed to recovery ras core, ret:%d\n", ret);
+
+		if (!ret)
+			if (ras_fw_eeprom_supported(ras_core))
+				ras_fw_eeprom_check_storage_status(ras_core);
+			else
+				ras_eeprom_check_storage_status(ras_core);
 	}
 
-	if (ras_fw_eeprom_supported(ras_core))
-		ret = ras_fw_eeprom_check_storage_status(ras_core);
-	else
-		ret = ras_eeprom_check_storage_status(ras_core);
-	if (ret)
-		goto init_err6;
-
 	ret = ras_process_init(ras_core);
 	if (ret)
-		goto init_err7;
+		goto init_err6;
 
 	ras_core->is_initialized = true;
 
 	return 0;
 
-init_err7:
+init_err6:
 	if (ras_fw_eeprom_supported(ras_core))
 		ras_fw_eeprom_hw_fini(ras_core);
 	else
 		ras_eeprom_hw_fini(ras_core);
-init_err6:
+
 	ras_gfx_hw_fini(ras_core);
 init_err5:
 	ras_umc_hw_fini(ras_core);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

AMD General

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: Monday, August 10, 2026 14:50
To: [email protected]
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH] drm/amd/ras: ignore ras eeprom init errors

Even eeprom is not functional, other RAS functions can still work, no need to block the whole driver initialization.

---
 drivers/gpu/drm/amd/ras/core/core.c | 31 +++++++++++++----------------
 1 file changed, 14 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/ras/core/core.c +14 -17
index 9d24d3b48d74..6e5503f53bbf 100644
@@ -408,37 +408,34 @@ int ras_core_hw_init(struct ras_core_context *ras_core)
                ret = ras_fw_eeprom_hw_init(ras_core);
        else
                ret = ras_eeprom_hw_init(ras_core);
-       if (ret)
-               goto init_err6;
 
-       ret = ras_core_eeprom_recovery(ras_core);
-       if (ret) {
-               RAS_DEV_ERR(ras_core->dev,
-                       "Failed to recovery ras core, ret:%d\n", ret);
-               goto init_err6;
+       if (!ret) {
+               ret = ras_core_eeprom_recovery(ras_core);
+               if (ret)
+                       RAS_DEV_ERR(ras_core->dev,
+                               "Failed to recovery ras core, ret:%d\n", ret);
+
+               if (!ret)
+                       if (ras_fw_eeprom_supported(ras_core))
+                               ras_fw_eeprom_check_storage_status(ras_core);
+                       else
+                               ras_eeprom_check_storage_status(ras_core);
        }
 
-       if (ras_fw_eeprom_supported(ras_core))
-               ret = ras_fw_eeprom_check_storage_status(ras_core);
-       else
-               ret = ras_eeprom_check_storage_status(ras_core);
-       if (ret)
-               goto init_err6;
-
        ret = ras_process_init(ras_core);
        if (ret)
-               goto init_err7;
+               goto init_err6;
 
        ras_core->is_initialized = true;
 
        return 0;
 
-init_err7:
+init_err6:
        if (ras_fw_eeprom_supported(ras_core))
                ras_fw_eeprom_hw_fini(ras_core);
        else
                ras_eeprom_hw_fini(ras_core);
-init_err6:
+
        ras_gfx_hw_fini(ras_core);
 init_err5:
        ras_umc_hw_fini(ras_core);

--
2.34.1