RE: [PATCH] drm/amd/ras: ignore ras eeprom init errors

"Zhang, Hawking" <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <EAYPR12MB999158C4D1681F1E0322937846FCDE2@EAYPR12MB999158.namprd12.prod.outlook.com>
AMD General

Reviewed-by: Hawking Zhang <[email protected]>

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.

Signed-off-by: Tao Zhou <[email protected]>
---
 drivers/gpu/drm/amd/ras/core/core.c | 31 +++++++++++++----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/ras/core/core.c b/drivers/gpu/drm/amd/ras/core/core.c
index 9d24d3b48d74..6e5503f53bbf 100644
--- a/drivers/gpu/drm/amd/ras/core/core.c
+++ b/drivers/gpu/drm/amd/ras/core/core.c
@@ -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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.