drm/amd/pm: Check SMUv13.0.6/12 metrics integrity
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +4 -0
@@ -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; }
Signature · 1 line
2.49.0
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Asad Kamal <[email protected]>
Thanks & Regards
Asad
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Saturday, April 18, 2026 6:21 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Kamal, Asad <[email protected]>
Subject: [PATCH] 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 <[email protected]>
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +4 -0
@@ -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; }
--
2.49.0