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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: Add smu vram copy function

Add a wrapper function for copying data/to from vram. This additionally
checks for any RAS fatal error. Copy cannot be trusted if any RAS fatal
error happened as VRAM becomes inaccessible.

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>

authored by

Lijo Lazar and committed by
Alex Deucher
f2275ea9 1d0a26cf

+15
+12
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
··· 1104 1104 return 0; 1105 1105 } 1106 1106 1107 + int smu_cmn_vram_cpy(struct smu_context *smu, void *dst, const void *src, 1108 + size_t len) 1109 + { 1110 + memcpy(dst, src, len); 1111 + 1112 + /* Don't trust the copy operation if RAS fatal error happened. */ 1113 + if (amdgpu_ras_get_fed_status(smu->adev)) 1114 + return -EHWPOISON; 1115 + 1116 + return 0; 1117 + } 1118 + 1107 1119 int smu_cmn_write_watermarks_table(struct smu_context *smu) 1108 1120 { 1109 1121 void *watermarks_table = smu->smu_table.watermarks_table;
+3
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.h
··· 174 174 void *table_data, 175 175 bool drv2smu); 176 176 177 + int smu_cmn_vram_cpy(struct smu_context *smu, void *dst, 178 + const void *src, size_t len); 179 + 177 180 int smu_cmn_write_watermarks_table(struct smu_context *smu); 178 181 179 182 int smu_cmn_write_pptable(struct smu_context *smu);