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

drm/amdgpu: Remove volatile from RLC files

The RLC uses volatile with some pointers that are not directly related
to any of the situations where volatile is advised to be used [1]. For
this reason, this commit removes all the volatile occurrences associated
with RLC.

1. https://docs.kernel.org/process/volatile-considered-harmful.html

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rodrigo Siqueira <siqueira@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rodrigo Siqueira and committed by
Alex Deucher
b8fc5410 d8586afe

+4 -4
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
··· 89 89 int amdgpu_gfx_rlc_init_sr(struct amdgpu_device *adev, u32 dws) 90 90 { 91 91 const u32 *src_ptr; 92 - volatile u32 *dst_ptr; 92 + u32 *dst_ptr; 93 93 u32 i; 94 94 int r; 95 95 ··· 189 189 void amdgpu_gfx_rlc_setup_cp_table(struct amdgpu_device *adev) 190 190 { 191 191 const __le32 *fw_data; 192 - volatile u32 *dst_ptr; 192 + u32 *dst_ptr; 193 193 int me, i, max_me; 194 194 u32 bo_offset = 0; 195 195 u32 table_offset, table_size;
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h
··· 275 275 /* for power gating */ 276 276 struct amdgpu_bo *save_restore_obj; 277 277 uint64_t save_restore_gpu_addr; 278 - volatile uint32_t *sr_ptr; 278 + uint32_t *sr_ptr; 279 279 const u32 *reg_list; 280 280 u32 reg_list_size; 281 281 /* for clear state */ ··· 287 287 /* for cp tables */ 288 288 struct amdgpu_bo *cp_table_obj; 289 289 uint64_t cp_table_gpu_addr; 290 - volatile uint32_t *cp_table_ptr; 290 + uint32_t *cp_table_ptr; 291 291 u32 cp_table_size; 292 292 293 293 /* safe mode for updating CG/PG state */