Skip to contentSkip to conversation

drm/amdgpu/ras: Select EEPROM ops based on PSP IP version

PATCH In review Ce Sun 2 participants 2 messages Oct 22

Subsystems (2)
lore
Share & tools
lore

Ce Sun

author
#0 lore raw

PATCH 1/1 drm/amdgpu/ras: Select EEPROM ops based on PSP IP version

Replace RAS EEPROM feature-status checking with PSP IP version based EEPROM ops selection. Determine FW/DRV EEPROM support according to the PSP IP version instead of querying RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM.

---
 drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c | 24 ++++++-------------
 1 file changed, 7 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +7 -17
index c6869b4ef598..0531ff35a299 100644
@@ -26,7 +26,6 @@
 #include "ras.h"
 #include "eeprom.h"
 #include "eeprom_fw.h"
-#include "ras_mp1.h"
 
 static bool __ras_eeprom_disabled(struct ras_core_context *ras_core)
 {
@@ -37,34 +36,25 @@ static const struct ras_eeprom_ops *ras_eeprom_mgr_get_ip_func(
 				struct ras_core_context *ras_core, uint32_t ip_version)
 {
 	struct ras_eeprom_mgr *mgr = &ras_core->eeprom_mgr;
-	int ret = 0;
-	u32 status = 0;
-
-	ret = ras_mp1_check_feature_status(ras_core, RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM, &status);
-	if (ret)
-		RAS_DEV_ERR(ras_core->dev, "Check RAS EEPROM feature failed, ret=%d", ret);
 
 	switch (ip_version) {
 	case IP_VERSION(13, 0, 6):
 	case IP_VERSION(13, 0, 12):
 	case IP_VERSION(13, 0, 14):
 		mgr->eeprom_early_init_service_supported = false;
-		break;
+		return &ras_drv_eeprom_ops;
+	case IP_VERSION(13, 0, 15):
 	case IP_VERSION(15, 0, 8):
 		mgr->eeprom_early_init_service_supported = true;
-		break;
+		mgr->fw_record_enabled = true;
+		return &ras_fw_eeprom_ops;
 	default:
 		RAS_DEV_ERR(ras_core->dev,
 			"EEPROM(MP1) ip version(0x%x) is not supported!\n", ip_version);
-		return NULL;
+		break;
 	}
 
-	if (status) {
-		mgr->fw_record_enabled = true;
-		return &ras_fw_eeprom_ops;
-	} else {
-		return &ras_drv_eeprom_ops;
-	}
+	return NULL;
 }
 
 int ras_eeprom_mgr_sw_init(struct ras_core_context *ras_core)
@@ -96,7 +86,7 @@ int ras_eeprom_mgr_sw_init(struct ras_core_context *ras_core)
 	mgr->ras_err_threshold = param_cfg.eeprom_record_threshold_count;
 	mgr->work_mode_over_thresh = param_cfg.work_mode_over_thresh;
 	mgr->eeprom_ip_version = param_cfg.eeprom_ip_version;
-	mgr->eeprom_ops = ras_eeprom_mgr_get_ip_func(ras_core, mgr->eeprom_ip_version);
+	mgr->eeprom_ops = ras_eeprom_mgr_get_ip_func(ras_core, ras_core->config->psp_ip_version);
 	if (!mgr->eeprom_ops)
 		return -ENODEV;
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

AMD General

Regards,
Hawking
-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Thursday, October 22, 2026 10:46 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Chai, Thomas <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Sun, Ce(Overlord) <[email protected]>
Subject: [PATCH] drm/amdgpu/ras: Select EEPROM ops based on PSP IP version

Replace RAS EEPROM feature-status checking with PSP IP version based EEPROM ops selection. Determine FW/DRV EEPROM support according to the PSP IP version instead of querying RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM.

---
 drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c | 24 ++++++-------------
 1 file changed, 7 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +0 -1
index c6869b4ef598..0531ff35a299 100644
@@ -26,7 +26,6 @@
 #include "ras.h"
 #include "eeprom.h"
 #include "eeprom_fw.h"
-#include "ras_mp1.h"
 
 static bool __ras_eeprom_disabled(struct ras_core_context *ras_core)  { @@ -37,34 +36,25 @@ static const struct ras_eeprom_ops *ras_eeprom_mgr_get_ip_func(
                                struct ras_core_context *ras_core, uint32_t ip_version)  {
        struct ras_eeprom_mgr *mgr = &ras_core->eeprom_mgr;

- int ret = 0;
- u32 status = 0;
-
- ret = ras_mp1_check_feature_status(ras_core, RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM, &status);
- if (ret)
- RAS_DEV_ERR(ras_core->dev, "Check RAS EEPROM feature failed, ret=%d", ret);

        switch (ip_version) {
        case IP_VERSION(13, 0, 6):
        case IP_VERSION(13, 0, 12):
        case IP_VERSION(13, 0, 14):
                mgr->eeprom_early_init_service_supported = false;
-               break;
+               return &ras_drv_eeprom_ops;
+       case IP_VERSION(13, 0, 15):
        case IP_VERSION(15, 0, 8):
                mgr->eeprom_early_init_service_supported = true;
-               break;
+               mgr->fw_record_enabled = true;
+               return &ras_fw_eeprom_ops;
        default:
                RAS_DEV_ERR(ras_core->dev,
                        "EEPROM(MP1) ip version(0x%x) is not supported!\n", ip_version);
-               return NULL;
+               break;
        }

- if (status) {
- mgr->fw_record_enabled = true;
- return &ras_fw_eeprom_ops;
- } else {
- return &ras_drv_eeprom_ops;
- }
+ return NULL;
}

int ras_eeprom_mgr_sw_init(struct ras_core_context *ras_core) @@ -96,7 +86,7 @@ int ras_eeprom_mgr_sw_init(struct ras_core_context *ras_core)

        mgr->ras_err_threshold = param_cfg.eeprom_record_threshold_count;
        mgr->work_mode_over_thresh = param_cfg.work_mode_over_thresh;
        mgr->eeprom_ip_version = param_cfg.eeprom_ip_version;
-       mgr->eeprom_ops = ras_eeprom_mgr_get_ip_func(ras_core, mgr->eeprom_ip_version);
+       mgr->eeprom_ops = ras_eeprom_mgr_get_ip_func(ras_core,
+ras_core->config->psp_ip_version);
        if (!mgr->eeprom_ops)
                return -ENODEV;

--
2.34.1