[Public] OK, that's a better solution. Best Regards, Yifan -----Original Message----- From: Alex Deucher <alexdeucher@xxxxxxxxx> Sent: Tuesday, August 30, 2022 11:31 PM To: Zhang, Yifan <Yifan1.Zhang@xxxxxxx> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Huang, Tim <Tim.Huang@xxxxxxx>; Xiao, Jack <Jack.Xiao@xxxxxxx>; Du, Xiaojian <Xiaojian.Du@xxxxxxx> Subject: Re: [PATCH] drm/amdgpu/mes: zero the sdma_hqd_mask of 2nd SDMA engine for SDMA 6.0.1 On Tue, Aug 30, 2022 at 11:24 AM Yifan Zhang <yifan1.zhang@xxxxxxx> wrote: > > there is only one SDMA engine in SDMA 6.0.1, the sdma_hqd_mask has to > be zeroed for the 2nd engine, otherwise MES scheduler will consider > 2nd engine exists and map/unmap SDMA queues to the non-existent engine. > > Signed-off-by: Yifan Zhang <yifan1.zhang@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > index fe82b8b19a4e..f876fd62ab81 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > @@ -185,6 +185,14 @@ int amdgpu_mes_init(struct amdgpu_device *adev) > adev->mes.sdma_hqd_mask[i] = 0xfc; > } > > + /* there is only one SDMA engine in SDMA 6.0.1, the sdma_hqd_mask > + * has to be zeroed for the 2nd engine, otherwise MES scheduler will > + * consider 2nd engine exists and map/unmap SDMA queues to the non-existent > + * engine. > + */ > + if (adev->ip_versions[SDMA0_HWIP][0] == IP_VERSION(6, 0, 1)) How about checking for the number of instances rather than a specific IP version? E.g., if (adev->sdma.num_instances == 1) This makes things more future proof for newer SDMA 6.x IPs. Alex > + adev->mes.sdma_hqd_mask[AMDGPU_MES_MAX_SDMA_PIPES - 1] > + = 0; > + > r = amdgpu_device_wb_get(adev, &adev->mes.sch_ctx_offs); > if (r) { > dev_err(adev->dev, > -- > 2.37.1 >