mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
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:
parent
bc621e91d6
commit
6fc63d80c0
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user