Commit c3f13369961a7be6b19fe838ac4b5a7bc8592b16

Con Kolivas 2013-11-08T18:15:08

Do the driver flush in avalon code lockless since it can lead to deadlocks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/driver-avalon.c b/driver-avalon.c
index 53704e9..72359d4 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -1520,10 +1520,9 @@ static void avalon_flush_work(struct cgpu_info *avalon)
 {
 	struct avalon_info *info = avalon->device_data;
 
-	mutex_lock(&info->qlock);
-	/* Will overwrite any work queued */
+	/* Will overwrite any work queued. Do this unlocked since it's just
+	 * changing a single non-critical value and prevents deadlocks */
 	avalon->queued = 0;
-	mutex_unlock(&info->qlock);
 
 	/* Signal main loop we need more work */
 	cgsem_post(&info->qsem);