AMD General
> -----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.
>
> 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 | 22 +++++++++++++------
> 2 files changed, 16 insertions(+), 8 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..6b9661409534 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,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;
[Tao] for old FW, do we need to set return value to ras_drv_eeprom_ops instead
of 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)
> --
> 2.34.1