patch-2.4.0-test9 linux/drivers/char/drm/lock.c

Next file: linux/drivers/char/drm/mga_bufs.c
Previous file: linux/drivers/char/drm/lists.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/char/drm/lock.c linux/drivers/char/drm/lock.c
@@ -50,7 +50,6 @@
 {
 	unsigned int old, new, prev;
 
-	DRM_DEBUG("%d attempts\n", context);
 	do {
 		old = *lock;
 		if (old & _DRM_LOCK_HELD) new = old | _DRM_LOCK_CONT;
@@ -68,11 +67,8 @@
 	}
 	if (new == (context | _DRM_LOCK_HELD)) {
 				/* Have lock */
-		DRM_DEBUG("%d\n", context);
 		return 1;
 	}
-	DRM_DEBUG("%d unable to get lock held by %d\n",
-		  context, _DRM_LOCKING_CONTEXT(old));
 	return 0;
 }
 
@@ -89,7 +85,6 @@
 		new  = context | _DRM_LOCK_HELD;
 		prev = cmpxchg(lock, old, new);
 	} while (prev != old);
-	DRM_DEBUG("%d => %d\n", _DRM_LOCKING_CONTEXT(old), context);
 	return 1;
 }
 
@@ -99,7 +94,6 @@
 	unsigned int old, new, prev;
 	pid_t        pid = dev->lock.pid;
 
-	DRM_DEBUG("%d\n", context);
 	dev->lock.pid = 0;
 	do {
 		old  = *lock;
@@ -128,10 +122,10 @@
 	atomic_inc(&q->use_count);
 	if (atomic_read(&q->use_count) > 1) {
 		atomic_inc(&q->block_write);
-		current->state = TASK_INTERRUPTIBLE;
 		add_wait_queue(&q->flush_queue, &entry);
 		atomic_inc(&q->block_count);
 		for (;;) {
+			current->state = TASK_INTERRUPTIBLE;
 			if (!DRM_BUFCOUNT(&q->waitlist)) break;
 			schedule();
 			if (signal_pending(current)) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)