Skip to contentSkip to conversation

drm/amdgpu/pm: skip the power source check on smu v14.0.2/3

PATCH In review Kenneth Feng 3 participants 3 messages Nov 19, 2024

Subsystems (3)
lore
Share & tools
lore

Kenneth Feng

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/pm: skip the power source check on smu v14.0.2/3

skip the power source check on smu v14.0.2/3

---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +4 -0
index 5460f8e62264..b60837bd259f 100644
@@ -1365,6 +1365,10 @@ int smu_v14_0_set_power_source(struct smu_context *smu,
 {
 	int pwr_source;
 
+	if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 2)) ||
+	    (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 3)))
+		return 0;
+
 	pwr_source = smu_cmn_to_asic_specific_index(smu,
 						    CMN2ASIC_MAPPING_PWR,
 						    (uint32_t)power_src);
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Kenneth Feng <[email protected]>
Sent: Tuesday, November 19, 2024 13:48
To: [email protected]
Cc: Wang, Yang(Kevin) <[email protected]>; Feng, Kenneth <[email protected]>
Subject: [PATCH] drm/amdgpu/pm: skip the power source check on smu v14.0.2/3

skip the power source check on smu v14.0.2/3

---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +4 -0
index 5460f8e62264..b60837bd259f 100644
@@ -1365,6 +1365,10 @@ int smu_v14_0_set_power_source(struct smu_context *smu,  {
        int pwr_source;
 
+       if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 2)) ||
+           (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 3)))
+               return 0;
+

[kevin]:

I prefer to implement a new callback function in smu_v14_0_2_ppt.c source file, to avoid add version check in IP level source code.

Best Regards,
Kevin

pwr_source = smu_cmn_to_asic_specific_index(smu,
CMN2ASIC_MAPPING_PWR, (uint32_t)power_src);
--
2.34.1

#2 lore raw
In reply to Kenneth Feng
Quoted 12 lines · Kenneth Feng

skip the power source check on smu v14.0.2/3

---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +0 -0
index 5460f8e62264..b60837bd259f 100644

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c int smu_v14_0_set_power_source(struct smu_context *smu, · line 1371

Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +4 -0
@@ -1365,6 +1365,10 @@ int smu_v14_0_set_power_source(struct smu_context *smu,
 {
 	int pwr_source;
 
+	if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 2)) ||
+	    (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 3)))
+		return 0;
+

.set_power_source = smu_v14_0_set_power_source

The right way is to set this to NULL or remove this line.

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +0 -0
 	pwr_source = smu_cmn_to_asic_specific_index(smu,
 						    CMN2ASIC_MAPPING_PWR,
 						    (uint32_t)power_src);