AMD General
This will keep the MES unmap notify sent out of a GPU recovery, which make sure
an available MES for serving the unmap notify request.
Ping. Any comments on this patch? Reviews are appreciated.
Regards,
Prike
> -----Original Message-----
> From: amd-gfx <[email protected]> On Behalf Of Prike Liang
> Sent: Tuesday, September 29, 2026 11:47 AM
> To: [email protected]
> Cc: Deucher, Alexander <[email protected]>; Koenig, Christian
> <[email protected]>; Prosyak, Vitaly <[email protected]>; Liang,
> Prike <[email protected]>
> Subject: [PATCH v2 10/14] drm/amdgpu/mes: defer unmap notifications across GPU
> reset
>
> Acquire the reset-domain semaphore for read with a trylock before sending the
> MES
> unmap notification. If recovery owns it, skip the hardware access but retain
> the
> periodic rearm while queues remain oversubscribed.
>
> Signed-off-by: Prike Liang <[email protected]>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index 4cb37cdbf821..4138080edbea 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -1192,7 +1192,11 @@ static void
> amdgpu_mes_userq_notify_unmap_work_handler(struct work_struct *work)
> userq_notify_unmap_work.work);
> struct amdgpu_device *adev = mes->adev;
>
> - amdgpu_mes_notify_unmap_queue(adev);
> + /* Do not block reset-time cancellation or lose the periodic retry. */
> + if (down_read_trylock(&adev->reset_domain->sem)) {
> + amdgpu_mes_notify_unmap_queue(adev);
> + up_read(&adev->reset_domain->sem);
> + }
>
> /* Re-arm if still oversubscribed */
> if (atomic_read(&mes->userq_hw_queue_count) >
> --
> 2.34.1