On 12-Oct-26 7:30 AM, Zhang, Hawking wrote:
AMD General
Reviewed-by: Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: Sun, Ce(Overlord) <[email protected]>
Sent: Monday, October 12, 2026 9:40 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 v3] 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.
Signed-off-by: Ce Sun <[email protected]>
---
drivers/gpu/drm/amd/ras/core/ras.h | 2 +-
drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c | 23 ++++++++++++++-----
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/ras/core/ras.h
b/drivers/gpu/drm/amd/ras/core/ras.h
index 73e3960c7c8e..1b724aa23594 100644
--- a/drivers/gpu/drm/amd/ras/core/ras.h
+++ b/drivers/gpu/drm/amd/ras/core/ras.h
@@ -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 {
diff --git a/drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c
b/drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c
index fe0e35357af1..e1b70dd7b819 100644
--- a/drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c
+++ b/drivers/gpu/drm/amd/ras/core/ras_eeprom_mgr.c
@@ -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,35 @@ 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);
Feature status check cannot be done at this stage. Anything which is
dependent on a FW feature can only be checked after hw init phase after
features are enabled.
Thanks,
Lijo
+ 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, 14):
case IP_VERSION(13, 0, 12):
+ case IP_VERSION(13, 0, 14):
case IP_VERSION(13, 0, 15):
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)
--
2.34.1