[PATCH 4/4] drm/amd/display: Restore deleted patch to resolve reset deadlock.
Kazlauskas, Nicholas
Nicholas.Kazlauskas at amd.com
Thu Apr 11 16:41:14 UTC 2019
On 4/11/19 12:03 PM, Andrey Grodzovsky wrote:
> Patch '5edb0c9b Fix deadlock with display during hanged ring recovery'
> was accidentaly removed during one of DALs code merges.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
Probably got lost in a refactor.
Also, didn't Christian have a patch recently to not lock the reservation
object when waiting for the fence? Looks like that's missing too, or
maybe it didn't get merged.
Nicholas Kazlauskas
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 0648794..27e0383 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5138,14 +5138,21 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
> */
> abo = gem_to_amdgpu_bo(fb->obj[0]);
> r = amdgpu_bo_reserve(abo, true);
> - if (unlikely(r != 0)) {
> + if (unlikely(r != 0))
> DRM_ERROR("failed to reserve buffer before flip\n");
> - WARN_ON(1);
> - }
>
> - /* Wait for all fences on this FB */
> - WARN_ON(reservation_object_wait_timeout_rcu(abo->tbo.resv, true, false,
> - MAX_SCHEDULE_TIMEOUT) < 0);
> + /*
> + * Wait for all fences on this FB. Do limited wait to avoid
> + * deadlock during GPU reset when this fence will not signal
> + * but we hold reservation lock for the BO.
> + */
> + r = reservation_object_wait_timeout_rcu(abo->tbo.resv,
> + true, false,
> + msecs_to_jiffies(5000));
> + if (unlikely(r == 0))
> + DRM_ERROR("Waiting for fences timed out.");
> +
> +
>
> amdgpu_bo_get_tiling_flags(abo, &tiling_flags);
>
>
More information about the dri-devel
mailing list