Skip to content

Commit 4c64f2e

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Fix the return for average power on aldebaran
Aldebaran can only return average socket power for the first die. The other dies return 0. Instead of returning a bad value, return -EOPNOTSUPP so that the attribute will be hidden. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 0522821 commit 4c64f2e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,10 @@ static int aldebaran_get_smu_metrics_data(struct smu_context *smu,
625625
break;
626626
case METRICS_AVERAGE_SOCKETPOWER:
627627
/* Valid power data is available only from primary die */
628-
*value = aldebaran_is_primary(smu) ?
629-
metrics->AverageSocketPower << 8 :
630-
0;
628+
if (aldebaran_is_primary(smu))
629+
*value = metrics->AverageSocketPower << 8;
630+
else
631+
ret = -EOPNOTSUPP;
631632
break;
632633
case METRICS_TEMPERATURE_EDGE:
633634
*value = metrics->TemperatureEdge *

0 commit comments

Comments
 (0)