Skip to contentSkip to conversation

drm/amd/ras: Use MP1 feature status to select fw-managed EEPROM

PATCH Superseded Ce Sun 2 participants 2 messages Oct 10

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ce Sun

author
#0 lore raw

PATCH 1/1 drm/amd/ras: Use MP1 feature status to select fw-managed EEPROM

Read the feature status of RAS_CORE_FW_FEATURE_BIT_RAS_EEPROM to determine whether to use firmware-managed EEPROM.

---
 drivers/gpu/drm/amd/ras/core/ras.h            |  2 +-
 drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c | 22 +++++++++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/ras/core/ras.h +1 -1
index 73e3960c7c8e..1b724aa23594 100644
@@ -60,7 +60,7 @@ enum ras_gpu_health_status {
 };
 
 enum ras_core_fw_feature_flags {
-	RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM = BIT_ULL(0),
+	RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM = 0,
 };
 
 enum ras_block_id {
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +15 -7
index fe0e35357af1..6b9661409534 100644
@@ -26,6 +26,7 @@
 #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)
 {
@@ -36,25 +37,32 @@ 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;
+	u32 status;
+
+	if (ras_mp1_check_feature_status(ras_core, RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM, &status))
+		return NULL;
 
 	switch (ip_version) {
 	case IP_VERSION(13, 0, 6):
-	case IP_VERSION(13, 0, 14):
 	case IP_VERSION(13, 0, 12):
-	case IP_VERSION(13, 0, 15):
+	case IP_VERSION(13, 0, 14):
 		mgr->eeprom_early_init_service_supported = false;
-		return &ras_drv_eeprom_ops;
+		break;
 	case IP_VERSION(15, 0, 8):
 		mgr->eeprom_early_init_service_supported = true;
-		mgr->fw_record_enabled = true;
-		return &ras_fw_eeprom_ops;
+		break;
 	default:
 		RAS_DEV_ERR(ras_core->dev,
 			"EEPROM(MP1) ip version(0x%x) is not supported!\n", ip_version);
-		break;
+		return NULL;
 	}
 
-	return NULL;
+	if (status) {
+		mgr->fw_record_enabled = true;
+		return &ras_fw_eeprom_ops;
+	} else {
+		return &ras_drv_eeprom_ops;
+	}
 }
 
 int ras_eeprom_mgr_sw_init(struct ras_core_context *ras_core)
Signature · 1 line
2.34.1
#1 lore raw

AMD General

Quoted 50 lines

-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Saturday, October 10, 2026 6:36 PM
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/amd/ras: Use MP1 feature status to select fw-managed EEPROM

Read the feature status of RAS_CORE_FW_FEATURE_BIT_RAS_EEPROM to determine whether to use firmware-managed EEPROM.

---
 drivers/gpu/drm/amd/ras/core/ras.h            |  2 +-
 drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c | 22 +++++++++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/ras/core/ras.h +1 -1
index 73e3960c7c8e..1b724aa23594 100644
@@ -60,7 +60,7 @@ enum ras_gpu_health_status {  };
 
 enum ras_core_fw_feature_flags {
-     RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM = BIT_ULL(0),
+     RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM = 0,
 };
 
 enum ras_block_id {
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +2 -0
index fe0e35357af1..6b9661409534 100644
@@ -26,6 +26,7 @@
 #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)  { @@ -36,25
+37,32 @@ 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;
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +3 -0
+     u32 status;
+
+     if (ras_mp1_check_feature_status(ras_core,
Quoted 2 lines

RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM, &status))
+ return NULL;

[Tao] for old FW, do we need to set return value to ras_drv_eeprom_ops instead of NULL?

Quoted 35 lines
      switch (ip_version) {
      case IP_VERSION(13, 0, 6):
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +3 -5
-     case IP_VERSION(13, 0, 14):
      case IP_VERSION(13, 0, 12):
-     case IP_VERSION(13, 0, 15):
+     case IP_VERSION(13, 0, 14):
              mgr->eeprom_early_init_service_supported = false;
-             return &ras_drv_eeprom_ops;
+             break;
      case IP_VERSION(15, 0, 8):
              mgr->eeprom_early_init_service_supported = true;
-             mgr->fw_record_enabled = true;
-             return &ras_fw_eeprom_ops;
+             break;
      default:
              RAS_DEV_ERR(ras_core->dev,
                      "EEPROM(MP1) ip version(0x%x) is not supported!\n",

ip_version);

drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c +7 -3
-             break;
+             return NULL;
      }
 
-     return NULL;
+     if (status) {
+             mgr->fw_record_enabled = true;
+             return &ras_fw_eeprom_ops;
+     } else {
+             return &ras_drv_eeprom_ops;
+     }
 }
 
 int ras_eeprom_mgr_sw_init(struct ras_core_context *ras_core)
--

2.34.1