Skip to contentSkip to conversation

drm/amd/pm: Update SMUv13.0.6 PMFW headers

PATCH In review Asad Kamal 2 participants 4 messages Oct 4, 2024 – Oct 9, 2024

Subsystems (3)
lore
Share & tools
lore

Asad Kamal

author
#0 lore raw

PATCH 1/2 drm/amd/pm: Update SMUv13.0.6 PMFW headers

Update pmfw headers for smuv13.0.6 to version 0xE

---
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h +4 -1
index 822c6425d90e..0f96b8c59a0e 100644
@@ -123,7 +123,7 @@ typedef enum {
   VOLTAGE_GUARDBAND_COUNT
 } GFX_GUARDBAND_e;
 
-#define SMU_METRICS_TABLE_VERSION 0xD
+#define SMU_METRICS_TABLE_VERSION 0xE
 
 typedef struct __attribute__((packed, aligned(4))) {
   uint32_t AccumulationCounter;
@@ -231,6 +231,9 @@ typedef struct __attribute__((packed, aligned(4))) {
   // PER XCD ACTIVITY
   uint32_t GfxBusy[8];
   uint64_t GfxBusyAcc[8];
+
+  //PCIE BW Data and error count
+  uint32_t PCIeOtherEndRecoveryAcc;       // The Pcie counter itself is accumulated
 } MetricsTableX_t;
 
 typedef struct __attribute__((packed, aligned(4))) {
Signature · 1 line
2.46.0
author
#1 lore raw

PATCH 2/2 drm/amd/pm: Fill pcie recov cntr to metrics 1.6

Fill pcie other end recovery counter to metrics 1.6

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +12 -1
index 52f3c537bb3f..a85574a46769 100644
@@ -2306,7 +2306,8 @@ static int smu_v13_0_6_get_current_pcie_link_speed(struct smu_context *smu)
 
 static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table)
 {
-	bool per_inst, smu_13_0_6_per_inst, smu_13_0_14_per_inst, apu_per_inst;
+	bool per_inst, smu_13_0_6_per_inst, smu_13_0_14_per_inst, apu_per_inst,
+	     smu_13_0_6_rec_cnt, smu_13_0_14_rec_cnt;
 	struct smu_table_context *smu_table = &smu->smu_table;
 	struct gpu_metrics_v1_6 *gpu_metrics =
 		(struct gpu_metrics_v1_6 *)smu_table->gpu_metrics_table;
@@ -2417,6 +2418,16 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
 				metrics_x->PCIeNAKSentCountAcc;
 		gpu_metrics->pcie_nak_rcvd_count_acc =
 				metrics_x->PCIeNAKReceivedCountAcc;
+		smu_13_0_6_rec_cnt = (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)
+				== IP_VERSION(13, 0, 6)) &&
+			(smu->smc_fw_version >= 0x557600);
+		smu_13_0_14_rec_cnt = (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)
+				== IP_VERSION(13, 0, 14)) &&
+			(smu->smc_fw_version >= 0x05550E00);
+		if (smu_13_0_6_rec_cnt || smu_13_0_14_rec_cnt)
+			gpu_metrics->pcie_lc_perf_other_end_recovery =
+				metrics_x->PCIeOtherEndRecoveryAcc;
+
 	}
 
 	gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
Signature · 1 line
2.46.0
#2 lore raw

Re: [PATCH 2/2] drm/amd/pm: Fill pcie recov cntr to metrics 1.6

Quoted 22 lines · Asad Kamal

Fill pcie other end recovery counter to metrics 1.6

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +2 -1
index 52f3c537bb3f..a85574a46769 100644
@@ -2306,7 +2306,8 @@ static int smu_v13_0_6_get_current_pcie_link_speed(struct smu_context *smu)
 
 static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table)
 {
-	bool per_inst, smu_13_0_6_per_inst, smu_13_0_14_per_inst, apu_per_inst;
+	bool per_inst, smu_13_0_6_per_inst, smu_13_0_14_per_inst, apu_per_inst,
+	     smu_13_0_6_rec_cnt, smu_13_0_14_rec_cnt;
 	struct smu_table_context *smu_table = &smu->smu_table;
 	struct gpu_metrics_v1_6 *gpu_metrics =
 		(struct gpu_metrics_v1_6 *)smu_table->gpu_metrics_table;

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table · line 2426

Quoted 9 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +6 -0
@@ -2417,6 +2418,16 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
 				metrics_x->PCIeNAKSentCountAcc;
 		gpu_metrics->pcie_nak_rcvd_count_acc =
 				metrics_x->PCIeNAKReceivedCountAcc;
+		smu_13_0_6_rec_cnt = (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)
+				== IP_VERSION(13, 0, 6)) &&
+			(smu->smc_fw_version >= 0x557600);
+		smu_13_0_14_rec_cnt = (amdgpu_ip_version(smu->adev, MP1_HWIP, 0)
+				== IP_VERSION(13, 0, 14)) &&
+			(smu->smc_fw_version >= 0x05550E00);

Better move this to an inline function which checks IP version.

bool smu_v13_0_6_is_other_end_count_available(smu) {
switch (ip_version)

	case a:
		return fw_version > xyz;

}

That may be easier to read and manage for any future updates/IP version derivatives.

Thanks,
Lijo

Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +4 -0
+		if (smu_13_0_6_rec_cnt || smu_13_0_14_rec_cnt)
+			gpu_metrics->pcie_lc_perf_other_end_recovery =
+				metrics_x->PCIeOtherEndRecoveryAcc;
+
 	}
 
 	gpu_metrics->system_clock_counter = ktime_get_boottime_ns();
#3 lore raw
In reply to Asad Kamal

[AMD Official Use Only - AMD Internal Distribution Only]

Ping

-----Original Message-----
From: Kamal, Asad <[email protected]>
Sent: Friday, October 4, 2024 8:31 PM
To: [email protected]; Lazar, Lijo <[email protected]>
Cc: Ma, Le <[email protected]>; Zhang, Hawking <[email protected]>; Zhang, Morris <[email protected]>; Kamal, Asad <[email protected]>; Poag, Charis <[email protected]>; Cheung, Donald <[email protected]>; Khatir, Sepehr <[email protected]>; Oliveira, Daniel <[email protected]>
Subject: [PATCH 1/2] drm/amd/pm: Update SMUv13.0.6 PMFW headers

Update pmfw headers for smuv13.0.6 to version 0xE

---
 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_6_pmfw.h +4 -1
index 822c6425d90e..0f96b8c59a0e 100644
@@ -123,7 +123,7 @@ typedef enum {
   VOLTAGE_GUARDBAND_COUNT
 } GFX_GUARDBAND_e;
 
-#define SMU_METRICS_TABLE_VERSION 0xD
+#define SMU_METRICS_TABLE_VERSION 0xE
 
 typedef struct __attribute__((packed, aligned(4))) {
   uint32_t AccumulationCounter;
@@ -231,6 +231,9 @@ typedef struct __attribute__((packed, aligned(4))) {
   // PER XCD ACTIVITY
   uint32_t GfxBusy[8];
   uint64_t GfxBusyAcc[8];
+
+  //PCIE BW Data and error count
+  uint32_t PCIeOtherEndRecoveryAcc;       // The Pcie counter itself is accumulated
 } MetricsTableX_t;
 
 typedef struct __attribute__((packed, aligned(4))) {

--
2.46.0