Skip to contentSkip to conversation

drm/amd/pm: Do not support swSMU if SMU IP is disabled

PATCH In review Hawking Zhang 2 participants 2 messages Aug 20, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/pm: Do not support swSMU if SMU IP is disabled

When SMU IP is disabled by ip_block_mask, driver should not refer to any dpm/swSMU callback. Instead, any driver call into swSMU/dpm callback needs to return error code EOPNOTSUPP.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
index c803c903e47f..31943b4db276 100644
@@ -549,7 +549,8 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
 	if (adev->asic_type == CHIP_VEGA20)
 		return false;
 
-	if (amdgpu_ip_version(adev, MP1_HWIP, 0) >= IP_VERSION(11, 0, 0))
+	if ((amdgpu_ip_version(adev, MP1_HWIP, 0) >= IP_VERSION(11, 0, 0)) &&
+	    amdgpu_device_ip_is_valid(adev, AMD_IP_BLOCK_TYPE_SMC))
 		return true;
 
 	return false;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Best Regards,
Kevin

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Tuesday, August 20, 2024 2:31 PM
To: [email protected]; Wang, Yang(Kevin) <[email protected]>; Feng, Kenneth <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amd/pm: Do not support swSMU if SMU IP is disabled

When SMU IP is disabled by ip_block_mask, driver should not refer to any dpm/swSMU callback. Instead, any driver call into swSMU/dpm callback needs to return error code EOPNOTSUPP.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
index c803c903e47f..31943b4db276 100644
@@ -549,7 +549,8 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
        if (adev->asic_type == CHIP_VEGA20)
                return false;
 
-       if (amdgpu_ip_version(adev, MP1_HWIP, 0) >= IP_VERSION(11, 0, 0))
+       if ((amdgpu_ip_version(adev, MP1_HWIP, 0) >= IP_VERSION(11, 0, 0)) &&
+           amdgpu_device_ip_is_valid(adev, AMD_IP_BLOCK_TYPE_SMC))
                return true;
 
        return false;

--
2.17.1