Commit 07d48da4 authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher

drm/ttm: Simplify ttm_eu_reserve_buffers()

Hoist the comparison of the ret to -EDEADLK above
the two code paths to simplify the function.
Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent de8dfb8e
...@@ -139,13 +139,15 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, ...@@ -139,13 +139,15 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
*/ */
ttm_eu_backoff_reservation_reverse(list, entry); ttm_eu_backoff_reservation_reverse(list, entry);
if (ret == -EDEADLK && intr) { if (ret == -EDEADLK) {
if (intr) {
ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock, ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock,
ticket); ticket);
} else if (ret == -EDEADLK) { } else {
ww_mutex_lock_slow(&bo->resv->lock, ticket); ww_mutex_lock_slow(&bo->resv->lock, ticket);
ret = 0; ret = 0;
} }
}
if (!ret && entry->shared) if (!ret && entry->shared)
ret = reservation_object_reserve_shared(bo->resv); ret = reservation_object_reserve_shared(bo->resv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment