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>
This commit is contained in:
Lijo Lazar 2026-04-18 06:21:17 +05:30 committed by Alex Deucher
parent bc621e91d6
commit 6fc63d80c0

View File

@ -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;
}