summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2026-04-18 06:21:17 +0530
committerAlex Deucher <alexander.deucher@amd.com>2026-04-21 16:51:16 -0400
commit6fc63d80c01a480e3d2c98620f07d46e5bcfc85a (patch)
tree46cb9eb102f08c5f7cd54a1c57eb02b2d9cc303b /drivers
parentbc621e91d6fc004cfae9148c5a91acad19ada3e4 (diff)
downloadlinux-6fc63d80c01a480e3d2c98620f07d46e5bcfc85a.tar.gz
linux-6fc63d80c01a480e3d2c98620f07d46e5bcfc85a.zip
drm/amd/pm: Check SMUv13.0.6/12 metrics integrity
Check if data fetch is proper by matching the first few bytes against 0xFFs. If 0xFFs, that means data couldn't be read properly. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index cd0a23f432ff..36716541e505 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -783,6 +783,10 @@ int smu_v13_0_6_get_metrics_table(struct smu_context *smu, void *metrics_table,
if (ret)
return ret;
+ if (!memchr_inv(smu_table->metrics_table, 0xff,
+ min(16, table_size)))
+ return -EHWPOISON;
+
smu_table->metrics_time = jiffies;
}