Эх сурвалжийг харах

drm/ttm: Don't unreserve swapped BOs that were previously reserved

If ttm_bo_swapout doesn't own the lock, don't release it. Someone
else probably depends on it still being locked.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Felix Kuehling 7 жил өмнө
parent
commit
ad76c65ec3

+ 2 - 2
drivers/gpu/drm/ttm/ttm_bo.c

@@ -1780,8 +1780,8 @@ out:
 	 * Unreserve without putting on LRU to avoid swapping out an
 	 * Unreserve without putting on LRU to avoid swapping out an
 	 * already swapped buffer.
 	 * already swapped buffer.
 	 */
 	 */
-
-	reservation_object_unlock(bo->resv);
+	if (locked)
+		reservation_object_unlock(bo->resv);
 	kref_put(&bo->list_kref, ttm_bo_release_list);
 	kref_put(&bo->list_kref, ttm_bo_release_list);
 	return ret;
 	return ret;
 }
 }