[PATCH v5 10/10] drm/amdgpu: add delay after userqueue mapping

Alex Deucher alexdeucher at gmail.com
Thu Jul 6 17:41:47 UTC 2023


On Thu, Jul 6, 2023 at 8:36 AM Shashank Sharma <shashank.sharma at amd.com> wrote:
>
> It has been observed that the MES FW needs 250-300us to map the gfx
> userqueue, and if the user rings the doorbell before this duration,
> the FW never recognizes the work. This patch adds the delay of 300
> us after the queue mapping.
>
> V1: Moved the delay from userspace IOCTL to kernel (Alex).
>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Christian Koenig <christian.koenig at amd.com>
> Signed-off-by: Shashank Sharma <shashank.sharma at amd.com>
> Signed-off-by: Arvind Yadav <arvind.yadav at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 8edb020683a1..78b58c5d0fd8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -25,6 +25,7 @@
>  #include <linux/firmware.h>
>  #include <linux/module.h>
>  #include <linux/pci.h>
> +#include <linux/delay.h>
>  #include "amdgpu.h"
>  #include "amdgpu_gfx.h"
>  #include "amdgpu_psp.h"
> @@ -6749,6 +6750,12 @@ static int gfx_v11_0_userq_mqd_create(struct amdgpu_userq_mgr *uq_mgr,
>                 goto free_ctx;
>         }
>
> +       /*
> +        * It has been observed that HWS needs appx 250-300us to map the queue, and the
> +        * user needs to wait this duration before ringing the doorbell, or else the FW
> +        * will never recognize the work.
> +        */
> +       udelay(300);

Is there a way we can query the MES to verify that the queue is mapped
and ready?  We should talk to the MES team.  This is hacky and may
fail if the MES is busy, etc.

Alex


>         return 0;
>
>  free_ctx:
> --
> 2.40.1
>


More information about the amd-gfx mailing list