[PATCH v4] drm/amdgpu: Fix missing comment for mb() in 'amdgpu_device_aper_access'

Chen, Guchun Guchun.Chen at amd.com
Wed Aug 9 07:43:31 UTC 2023


[Public]

Reviewed-by: Guchun Chen <guchun.chen at amd.com>

Regards,
Guchun

> -----Original Message-----
> From: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>
> Sent: Wednesday, August 9, 2023 3:29 PM
> To: Koenig, Christian <Christian.Koenig at amd.com>; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Chen, Guchun <Guchun.Chen at amd.com>;
> Pan, Xinhui <Xinhui.Pan at amd.com>
> Cc: amd-gfx at lists.freedesktop.org; SHANMUGAM, SRINIVASAN
> <SRINIVASAN.SHANMUGAM at amd.com>
> Subject: [PATCH v4] 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 <guchun.chen at amd.com>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: "Pan, Xinhui" <Xinhui.Pan at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
> v4:
>  - Incorporated comments from (Lijo)
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4f818f13dc9d..65c36987f7d6 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);
>               }
> --
> 2.25.1



More information about the amd-gfx mailing list