Dependency locks fixes for QXL driver
Subsystems (3)
cover Dependency locks fixes for QXL driver
These two patches fixes two lock dependencies issues.
Frediano Ziglio (2):
drm/qxl: use to_qxl_bo macro
drm/qxl: avoid dependency lock
drivers/gpu/drm/qxl/qxl_object.c | 2 +- drivers/gpu/drm/qxl/qxl_release.c | 4 +--- drivers/gpu/drm/qxl/qxl_ttm.c | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-)
Signature · 6 lines
2.4.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/2 drm/qxl: use to_qxl_bo macro
Instead of using container_of directly use to_qxl_bo macro.
Signed-off-by Frediano Ziglio <[email protected]>
--- drivers/gpu/drm/qxl/qxl_object.c | 2 +- drivers/gpu/drm/qxl/qxl_ttm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/qxl/qxl_object.c +1 -1
@@ -32,7 +32,7 @@ static void qxl_ttm_bo_destroy(struct ttm_buffer_object *tbo)struct qxl_bo *bo;struct qxl_device *qdev; - bo = container_of(tbo, struct qxl_bo, tbo); + bo =to_qxl_bo (tbo); qdev = (struct qxl_device *)bo->gem_base.dev->dev_private;qxl_surface_evict (qdev, bo, false);
drivers/gpu/drm/qxl/qxl_ttm.c +2 -2
@@ -201,7 +201,7 @@ static void qxl_evict_flags(struct ttm_buffer_object *bo, placement->num_busy_placement =1 ;return ; } - qbo = container_of(bo, struct qxl_bo, tbo); + qbo =to_qxl_bo (bo);qxl_ttm_placement_from_domain (qbo,QXL_GEM_DOMAIN_CPU , false); *placement = qbo->placement; }
@@ -365,7 +365,7 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,if (!qxl_ttm_bo_is_qxl_bo (bo))return ; - qbo = container_of(bo, struct qxl_bo, tbo); + qbo =to_qxl_bo (bo); qdev = qbo->gem_base.dev->dev_private;if (bo->mem.mem_type ==TTM_PL_PRIV0 && qbo->surface_id)
Signature · 6 lines
2.4.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm/qxl: avoid dependency lock
In reply to Frediano Ziglioqxl_bo_unref calls drm_gem_object_unreference_unlocked which locks dev->struct_mutex. However this lock could be already locked if the call came from qxl_gem_object_free. As we don't need to call qxl_bo_ref/qxl_bo_unref cause qxl_release_list_add will hold a reference by itself avoid to call them and the possible deadlock.
Signed-off-by Frediano Ziglio <[email protected]>
--- drivers/gpu/drm/qxl/qxl_release.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/qxl/qxl_release.c +1 -3
@@ -307,7 +307,7 @@ int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, idr_ret =qxl_release_alloc (qdev,QXL_RELEASE_SURFACE_CMD , release);if (idr_ret <0 )return idr_ret; - bo =qxl_bo_ref (to_qxl_bo (entry->tv.bo)); + bo =to_qxl_bo (entry->tv.bo); (*release)->release_offset = create_rel->release_offset +64 ;
@@ -316,8 +316,6 @@ int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, info =qxl_release_map (qdev, *release); info->id = idr_ret;qxl_release_unmap (qdev, *release, info); - -qxl_bo_unref (&bo);return 0 ; }
Signature · 6 lines
2.4.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel