diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-22 08:47:43 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-22 08:47:43 +0000 |
commit | 4ab0fbd3a29067e1540f05093ae4ed07645d18c8 (patch) | |
tree | 7f027e92e4578e293b20ac1f2c389600a795ea7f /drivers/gpu/drm/ttm/ttm_bo.c | |
parent | f3c91c1deaf8493526d8216be94c33e963f00962 (diff) | |
parent | 3561d43fd289f590fdae672e5eb831b8d5cf0bf6 (diff) | |
download | talos-op-linux-4ab0fbd3a29067e1540f05093ae4ed07645d18c8.tar.gz talos-op-linux-4ab0fbd3a29067e1540f05093ae4ed07645d18c8.zip |
Merge remote branch 'linus' into drm-intel-fixes
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 3ca77dc03915..148a322d8f5d 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -224,6 +224,9 @@ int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, int ret; while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) { + /** + * Deadlock avoidance for multi-bo reserving. + */ if (use_sequence && bo->seq_valid && (sequence - bo->val_seq < (1 << 31))) { return -EAGAIN; @@ -241,6 +244,14 @@ int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, } if (use_sequence) { + /** + * Wake up waiters that may need to recheck for deadlock, + * if we decreased the sequence number. + */ + if (unlikely((bo->val_seq - sequence < (1 << 31)) + || !bo->seq_valid)) + wake_up_all(&bo->event_queue); + bo->val_seq = sequence; bo->seq_valid = true; } else { |