Route MESAPI_MISC__SETUP_MES_DBGEXT to the pipe named in the setup
request instead of the default MISC pipe, so each MES pipe can be
pointed at its own dbgext log region. Under unified MES the default is
the KIQ pipe, so both setup requests landed there and the scheduler
pipe never got a log buffer.

Signed-off-by: Yongqiang Sun <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
index b6356095b079..0f8b9e59d394 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
@@ -991,6 +991,10 @@ static int mes_v12_0_misc_op(struct amdgpu_mes *mes,
                                
input->change_config.option.limit_single_process;
                break;
        case MES_MISC_OP_SETUP_MES_DBGEXT:
+               /* The log buffer attaches to the pipe that receives this 
packet. */
+               if (input->setup_mes_dbgext.pipe >= AMDGPU_MAX_MES_PIPES)
+                       return -EINVAL;
+               pipe = input->setup_mes_dbgext.pipe;
                misc_pkt.opcode = MESAPI_MISC__SETUP_MES_DBGEXT;
                misc_pkt.dbgext_init_data.dbg_ext_mc_addr =
                                input->setup_mes_dbgext.log_buffer_mc_addr;
-- 
2.43.0

Reply via email to