Skip to contentSkip to conversation

drm/amdgpu: Set proper function to set xgmi pstate

PATCH In review Liu, Shaoyun 2 participants 3 messages Apr 5, 2019 – Apr 10, 2019 1 message not in the archive

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

PATCH 2/2 drm/amdgpu: Set proper function to set xgmi pstate

Driver need to call SMU to set xgmi pstate

Change-Id Iad7fd0e3b3155e45be8fe9119686c5bafa3c176c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +12 -1
index 3368347..a48c84c 100644
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include "amdgpu.h"
 #include "amdgpu_xgmi.h"
+#include "amdgpu_smu.h"
 
 
 static DEFINE_MUTEX(xgmi_mutex);
@@ -216,7 +217,17 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 
 	if (hive->pstate == pstate)
 		return 0;
-	/* Todo : sent the message to SMU for pstate change */
+
+	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
+
+	if (is_support_sw_smu(adev))
+		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
+	if (ret)
+		dev_err(adev->dev,
+			"XGMI: Set pstate failure on device %llx, hive %llx, ret %d",
+			adev->gmc.xgmi.node_id,
+			adev->gmc.xgmi.hive_id, ret);
+
 	return ret;
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1554480103-28214-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

ping

Quoted 29 lines · Shaoyun

Driver need to call SMU to set xgmi pstate

Change-Id Iad7fd0e3b3155e45be8fe9119686c5bafa3c176c
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +5 -1
index 3368347..a48c84c 100644
@@ -24,6 +24,7 @@
  #include <linux/list.h>
  #include "amdgpu.h"
  #include "amdgpu_xgmi.h"
+#include "amdgpu_smu.h"
 
 
  static DEFINE_MUTEX(xgmi_mutex);
@@ -216,7 +217,17 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 
  	if (hive->pstate == pstate)
  		return 0;
-	/* Todo : sent the message to SMU for pstate change */
+
+	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
+
+	if (is_support_sw_smu(adev))

drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate) · line 233

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +7 -0
+		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
+	if (ret)
+		dev_err(adev->dev,
+			"XGMI: Set pstate failure on device %llx, hive %llx, ret %d",
+			adev->gmc.xgmi.node_id,
+			adev->gmc.xgmi.hive_id, ret);
+
  	return ret;
  }
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive

'pstate' here (int) is with different data type from the 1st patch of this series(uint32_t there). Please check whether that can cause any potential issues.
With that confirmed, the patch is reviewed-by: Evan Quan <[email protected]>

Quoted 50 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Liu, Shaoyun
Sent: Saturday, April 06, 2019 12:02 AM
To: [email protected]
Cc: Liu, Shaoyun <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: Set proper function to set xgmi pstate

Driver need to call SMU to set xgmi pstate

Change-Id Iad7fd0e3b3155e45be8fe9119686c5bafa3c176c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +12 -1
index 3368347..a48c84c 100644
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include "amdgpu.h"
 #include "amdgpu_xgmi.h"
+#include "amdgpu_smu.h"
 
 
 static DEFINE_MUTEX(xgmi_mutex);
@@ -216,7 +217,17 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device
 *adev, int pstate)
 
 	if (hive->pstate == pstate)
 		return 0;
-	/* Todo : sent the message to SMU for pstate change */
+
+	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
+
+	if (is_support_sw_smu(adev))
+		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
+	if (ret)
+		dev_err(adev->dev,
+			"XGMI: Set pstate failure on device %llx, hive %llx,
 ret %d",
+			adev->gmc.xgmi.node_id,
+			adev->gmc.xgmi.hive_id, ret);
+
 	return ret;

}

Quoted 7 lines

--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx