]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/nouveau: increase reservation sequence every retry
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>
Tue, 15 Jan 2013 13:54:22 +0000 (14:54 +0100)
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>
Tue, 15 Jan 2013 13:54:22 +0000 (14:54 +0100)
This is temporary until the fence framework can be used. With the
lru/reservation atomicity removal it is possible to see your old
sequence number and the buffer being reserved, leading to erroneously
reporting -EDEADLK.

Workaround it by bumping the sequence number every retry.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
drivers/gpu/drm/nouveau/nouveau_gem.c

index 8bf695c52f95227fd6f8f3be407efffc558bdf24..9fcfcb2a020c9f16d105fed6ed3782e32b3172c6 100644 (file)
@@ -321,8 +321,8 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv,
        int trycnt = 0;
        int ret, i;
 
-       sequence = atomic_add_return(1, &drm->ttm.validate_sequence);
 retry:
+       sequence = atomic_add_return(1, &drm->ttm.validate_sequence);
        if (++trycnt > 100000) {
                NV_ERROR(drm, "%s failed and gave up.\n", __func__);
                return -EINVAL;