Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/amdgpu: Correct the power calcultion for Renior/Cezanne." failed to apply to 5.15-stable tree

PATCH [email protected] 1 participant 1 message Jan 22, 2023

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

c7bae4aaa560 ("drm/amdgpu: Correct the power calcultion for Renior/Cezanne.") 138292f1dc00 ("drm/amd/pm: update smartshift powerboost calc for smu12")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From c7bae4aaa5609c1fa9761c35dbcc5fcc92915222 Mon Sep 17 00:00:00 2001
From: jie1zhan <[email protected]>
Date: Fri, 13 Jan 2023 10:39:13 +0800
Subject: [PATCH] drm/amdgpu: Correct the power calcultion for Renior/Cezanne.

From smu firmware,the value of power is transferred in units of watts.

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c +6 -1
index 85e22210963f..5cdc07165480 100644
@@ -1171,6 +1171,7 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
 	int ret = 0;
 	uint32_t apu_percent = 0;
 	uint32_t dgpu_percent = 0;
+	struct amdgpu_device *adev = smu->adev;
 
 
 	ret = smu_cmn_get_metrics_table(smu,
@@ -1196,7 +1197,11 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
 		*value = metrics->AverageUvdActivity / 100;
 		break;
 	case METRICS_AVERAGE_SOCKETPOWER:
-		*value = (metrics->CurrentSocketPower << 8) / 1000;
+		if (((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1)) && (adev->pm.fw_version >= 0x40000f)) ||
+		((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0)) && (adev->pm.fw_version >= 0x373200)))
+			*value = metrics->CurrentSocketPower << 8;
+		else
+			*value = (metrics->CurrentSocketPower << 8) / 1000;
 		break;
 	case METRICS_TEMPERATURE_EDGE:
 		*value = (metrics->GfxTemperature / 100) *