On 06/07/2023 19:41, Alex Deucher wrote:
On Thu, Jul 6, 2023 at 8:36 AM Shashank Sharma <shashank.sha...@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.deuc...@amd.com>
Cc: Christian Koenig <christian.koe...@amd.com>
Signed-off-by: Shashank Sharma <shashank.sha...@amd.com>
Signed-off-by: Arvind Yadav <arvind.ya...@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.

So far I have not received any input on this, I can restart a discussion.

- Shashank

Alex


         return 0;

  free_ctx:
--
2.40.1

Reply via email to