diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-11-26 15:03:27 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-11-26 15:05:21 +0100 |
commit | 22a867d81707b0a2720bb5f65255265b95d30526 (patch) | |
tree | 7ec19b155b50b13ae95244c2bfa16aea4920c4f6 /drivers/gpu/drm/ttm/ttm_bo.c | |
parent | 5bb6b1ea67a73f0665a41726dd7138977b992c6c (diff) | |
parent | 3561d43fd289f590fdae672e5eb831b8d5cf0bf6 (diff) | |
download | blackbird-op-linux-22a867d81707b0a2720bb5f65255265b95d30526.tar.gz blackbird-op-linux-22a867d81707b0a2720bb5f65255265b95d30526.zip |
Merge commit 'v2.6.37-rc3' into sched/core
Merge reason: Pick up latest fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 { |