Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/powerplay: Add SMU WMTABLE Validity Check for Renoir

[Why]
SMU watermark table (WMTABLE) validity check is missing on Renoir.
This validity check is very useful for checking whether
WMTABLE is updated successfully.

[How]
Add SMU watermark validity check.

Signed-off-by: Zhan Liu <zhan.liu@amd.com>
Reviewed-by: Hersen Wu <hersenxs.wu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Zhan Liu and committed by
Alex Deucher
f1e1483b 374bf7bd

+10 -2
+10 -2
drivers/gpu/drm/amd/powerplay/renoir_ppt.c
··· 777 777 } 778 778 779 779 /* pass data to smu controller */ 780 - ret = smu_write_watermarks_table(smu); 780 + if ((smu->watermarks_bitmap & WATERMARKS_EXIST) && 781 + !(smu->watermarks_bitmap & WATERMARKS_LOADED)) { 782 + ret = smu_write_watermarks_table(smu); 783 + if (ret) { 784 + pr_err("Failed to update WMTABLE!"); 785 + return ret; 786 + } 787 + smu->watermarks_bitmap |= WATERMARKS_LOADED; 788 + } 781 789 782 - return ret; 790 + return 0; 783 791 } 784 792 785 793 static int renoir_get_power_profile_mode(struct smu_context *smu,