Skip to contentSkip to conversation

drm/amdgpu/pm: notify driver unloading to PMFW for SMU v13.0.6 dGPU

PATCH In review Le Ma 2 participants 2 messages Jun 2, 2023

Subsystems (3)
lore
Share & tools
lore

Le Ma

author
#0 lore raw

PATCH 1/1 drm/amdgpu/pm: notify driver unloading to PMFW for SMU v13.0.6 dGPU

Per requested, follow the same sequence as APU to send only PPSMC_MSG_PrepareForDriverUnload to PMFW during driver unloading.

Change-Id I2dc8495572b0bce6e21eafb51b215c83d94ac647
---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +7 -9
index 3da614faf75d..392ccebc8dac 100644
@@ -1409,18 +1409,16 @@ static int smu_v13_0_6_system_features_control(struct smu_context *smu,
 					      bool enable)
 {
 	struct amdgpu_device *adev = smu->adev;
-	int ret;
-
-	/* On APUs, notify FW that the device is no longer driver managed */
-	if (adev->flags & AMD_IS_APU) {
-		if (!enable)
-			smu_v13_0_6_notify_unload(smu);
+	int ret = 0;
 
-		return 0;
+	if (enable) {
+		if (!(adev->flags & AMD_IS_APU))
+			ret = smu_v13_0_system_features_control(smu, enable);
+	} else {
+		/* Notify FW that the device is no longer driver managed */
+		smu_v13_0_6_notify_unload(smu);
 	}
 
-	ret = smu_v13_0_system_features_control(smu, enable);
-
 	return ret;
 }
 
Signature · 1 line
2.38.1
Reviewed-by Reviewed-by Shiwu Zhang Reviewed-by Lijo Lazar on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Le Ma
Sent: Friday, June 2, 2023 10:42
To: [email protected]
Cc: Ma, Le <[email protected]>; Lazar, Lijo <[email protected]>; Zhang, Morris <[email protected]>
Subject: [PATCH 1/1] drm/amdgpu/pm: notify driver unloading to PMFW for SMU v13.0.6 dGPU

Per requested, follow the same sequence as APU to send only PPSMC_MSG_PrepareForDriverUnload to PMFW during driver unloading.

Change-Id I2dc8495572b0bce6e21eafb51b215c83d94ac647
---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +7 -9
index 3da614faf75d..392ccebc8dac 100644
@@ -1409,18 +1409,16 @@ static int smu_v13_0_6_system_features_control(struct smu_context *smu,
                                              bool enable)
 {
        struct amdgpu_device *adev = smu->adev;
-       int ret;
-
-       /* On APUs, notify FW that the device is no longer driver managed */
-       if (adev->flags & AMD_IS_APU) {
-               if (!enable)
-                       smu_v13_0_6_notify_unload(smu);
+       int ret = 0;
 
-               return 0;
+       if (enable) {
+               if (!(adev->flags & AMD_IS_APU))
+                       ret = smu_v13_0_system_features_control(smu, enable);
+       } else {
+               /* Notify FW that the device is no longer driver managed */
+               smu_v13_0_6_notify_unload(smu);
        }
 
-       ret = smu_v13_0_system_features_control(smu, enable);
-
        return ret;
 }
 

--
2.38.1