Skip to contentSkip to conversation

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

PATCH Superseded Ce Sun 3 participants 5 messages Oct 11 – Oct 12 1 message not in the archive

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ce Sun

author
#1 lore raw

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

In reply to a message not in the archive

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 | 24 +++++++++++++------
 2 files changed, 18 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 +17 -7
index fe0e35357af1..c6869b4ef598 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,34 @@ 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, 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
author
#5 lore raw

PATCH v2 2/2 drm/amd/pm: move smu_feature_init to smu_early_init

In reply to a message not in the archive

RAS early init executes prior to smu_sw_init, leaving feature_num as 0 and triggering invalid bitmap operations.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -1
index 44b2e8d8b956..9e9c1621b21e 100644
@@ -884,6 +884,9 @@ static int smu_early_init(struct amdgpu_ip_block *ip_block)
 	r = smu_set_funcs(adev);
 	if (r)
 		return r;
+
+	smu_feature_init(smu, SMU_FEATURE_NUM_DEFAULT);
+
 	return smu_init_microcode(smu);
 }
 
@@ -1417,7 +1420,6 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
 	int i, ret;
 
 	smu->pool_size = adev->pm.smu_prv_buffer_size;
-	smu_feature_init(smu, SMU_FEATURE_NUM_DEFAULT);
 
 	INIT_WORK(&smu->throttling_logging_work, smu_throttling_logging_work_fn);
 	INIT_WORK(&smu->interrupt_work, smu_interrupt_work_fn);
Signature · 1 line
2.34.1
#2 lore raw
In reply to Ce Sun

AMD General

- case IP_VERSION(13, 0, 14):

        case IP_VERSION(13, 0, 12):

- case IP_VERSION(13, 0, 15):
+ case IP_VERSION(13, 0, 14):

Both v13_0_12 and v13_0_15 can rely on the PMFW feature bits to determine whether the feature is supported, correct? If so, why is only v13_0_15 removed?

Additionally, since v13_0_15 has been removed from the switch statement, could this cause a NULL pointer to be returned before the feature status reported by PMFW is checked?

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Ce Sun
Sent: Sunday, October 11, 2026 10:50 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 v2 1/2] 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 | 24 +++++++++++++------
 2 files changed, 18 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 +1 -0
index fe0e35357af1..c6869b4ef598 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,34 @@ 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, 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

#3 lore raw

AMD General

Hi Hawking,
Thanks for your review.
The reason is that for MI350P, its MP1 is v13_0_12 (0xd000c00 = IP_VERSION(13, 0, 12)), while only MP0 is v13_0_15. Since this code path targets MP1, the old implementation was incorrect and we fixed it in this patch.

Thanks,
Ce Sun
________________________________
发件人: Zhang, Hawking <[email protected]>
发送时间: Sunday, 11 October 2026 22:57:44
收件人: Sun, Ce(Overlord) <[email protected]>; [email protected] <[email protected]>
抄送: Chai, Thomas <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Sun, Ce(Overlord) <[email protected]> 主题: RE: [PATCH v2 1/2] drm/amd/ras: Use MP1 feature status to select fw-managed EEPROM

AMD General

- case IP_VERSION(13, 0, 14):

        case IP_VERSION(13, 0, 12):

- case IP_VERSION(13, 0, 15):
+ case IP_VERSION(13, 0, 14):

Both v13_0_12 and v13_0_15 can rely on the PMFW feature bits to determine whether the feature is supported, correct? If so, why is only v13_0_15 removed?

Additionally, since v13_0_15 has been removed from the switch statement, could this cause a NULL pointer to be returned before the feature status reported by PMFW is checked?

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Ce Sun
Sent: Sunday, October 11, 2026 10:50 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 v2 1/2] 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 | 24 +++++++++++++------
 2 files changed, 18 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 +1 -0
index fe0e35357af1..c6869b4ef598 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,34 @@ 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, 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

#4 lore raw

AMD General

Hmm… if that’s the case, it indicates a bug in the IFWI that needs to be fixed.

Regards,
Hawking
From: Sun, Ce(Overlord) <[email protected]>
Sent: Sunday, October 11, 2026 11:32 PM
To: Zhang, Hawking <[email protected]>; [email protected]
Cc: Chai, Thomas <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: Re: [PATCH v2 1/2] drm/amd/ras: Use MP1 feature status to select fw-managed EEPROM

AMD General

Hi Hawking,
Thanks for your review.
The reason is that for MI350P, its MP1 is v13_0_12 (0xd000c00 = IP_VERSION(13, 0, 12)), while only MP0 is v13_0_15. Since this code path targets MP1, the old implementation was incorrect and we fixed it in this patch.

Thanks,
Ce Sun
________________________________
发件人: Zhang, Hawking <[email protected]<mailto:[email protected]>>
发送时间: Sunday, 11 October 2026 22:57:44
收件人: Sun, Ce(Overlord) <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
抄送: Chai, Thomas <[email protected]<mailto:[email protected]>>; Zhou1, Tao <[email protected]<mailto:[email protected]>>; Yang, Stanley <[email protected]<mailto:[email protected]>>; Sun, Ce(Overlord) <[email protected]<mailto:[email protected]>> 主题: RE: [PATCH v2 1/2] drm/amd/ras: Use MP1 feature status to select fw-managed EEPROM

AMD General

- case IP_VERSION(13, 0, 14):

        case IP_VERSION(13, 0, 12):

- case IP_VERSION(13, 0, 15):
+ case IP_VERSION(13, 0, 14):

Both v13_0_12 and v13_0_15 can rely on the PMFW feature bits to determine whether the feature is supported, correct? If so, why is only v13_0_15 removed?

Additionally, since v13_0_15 has been removed from the switch statement, could this cause a NULL pointer to be returned before the feature status reported by PMFW is checked?

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]<mailto:[email protected]>> On Behalf Of Ce Sun
Sent: Sunday, October 11, 2026 10:50 AM
To: [email protected]<mailto:[email protected]>
Cc: Zhang, Hawking <[email protected]<mailto:[email protected]>>; Chai, Thomas <[email protected]<mailto:[email protected]>>; Zhou1, Tao <[email protected]<mailto:[email protected]>>; Yang, Stanley <[email protected]<mailto:[email protected]>>; Sun, Ce(Overlord) <[email protected]<mailto:[email protected]>>
Subject: [PATCH v2 1/2] 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 | 24 +++++++++++++------
 2 files changed, 18 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 +1 -0
index fe0e35357af1..c6869b4ef598 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,34 @@ 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, 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