From: Srinivasan Shanmugam Date: Wed, 9 Aug 2023 05:29:40 +0000 (+0530) Subject: drm/amdgpu: Fix missing comment for mb() in 'amdgpu_device_aper_access' X-Git-Tag: v6.6.17~3937^2~6^2~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c452b5c7d73dadd8161a55a7a3f30599e4318aa;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: Fix missing comment for mb() in 'amdgpu_device_aper_access' This patch adds the missing code comment for memory barrier WARNING: memory barrier without comment + mb(); WARNING: memory barrier without comment + mb(); Cc: Guchun Chen Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 91d7f9e..97d202d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -305,10 +305,16 @@ size_t amdgpu_device_aper_access(struct amdgpu_device *adev, loff_t pos, if (write) { memcpy_toio(addr, buf, count); + /* Make sure HDP write cache flush happens without any reordering + * after the system memory contents are sent over PCIe device + */ mb(); amdgpu_device_flush_hdp(adev, NULL); } else { amdgpu_device_invalidate_hdp(adev, NULL); + /* Make sure HDP read cache is invalidated before issuing a read + * to the PCIe device + */ mb(); memcpy_fromio(buf, addr, count); }