Browse Source

bitforce: Wait to clear job queue (at init) until we have actually opened the device

Conflicts:
	driver-bitforce.c
Luke Dashjr 11 years ago
parent
commit
f0cf5ac593
1 changed files with 2 additions and 4 deletions
  1. 2 4
      driver-bitforce.c

+ 2 - 4
driver-bitforce.c

@@ -1357,9 +1357,6 @@ static bool bitforce_thread_init(struct thr_info *thr)
 			}
 			}
 			else
 			else
 				bitforce_change_mode(bitforce, BFP_QUEUE);
 				bitforce_change_mode(bitforce, BFP_QUEUE);
-			
-			// Clear job queue to start fresh; ignore response
-			bitforce_cmd1(fd, data->xlink_id, buf, sizeof(buf), "ZQX");
 		}
 		}
 		else
 		else
 		{
 		{
@@ -1411,7 +1408,7 @@ static bool bitforce_thread_init(struct thr_info *thr)
 
 
 	if (sc)
 	if (sc)
 	{
 	{
-		// Clear results queue last, to start fresh; ignore response
+		// Clear job and results queue, to start fresh; ignore response
 		int last_xlink_id = -1;
 		int last_xlink_id = -1;
 		for (bitforce = bitforce->device; bitforce; bitforce = bitforce->next_proc)
 		for (bitforce = bitforce->device; bitforce; bitforce = bitforce->next_proc)
 		{
 		{
@@ -1420,6 +1417,7 @@ static bool bitforce_thread_init(struct thr_info *thr)
 				continue;
 				continue;
 			last_xlink_id = data->xlink_id;
 			last_xlink_id = data->xlink_id;
 			thr = bitforce->thr[0];
 			thr = bitforce->thr[0];
+			bitforce_cmd1(fd, data->xlink_id, buf, sizeof(buf), "ZQX");
 			bitforce_zox(thr, "ZOX");
 			bitforce_zox(thr, "ZOX");
 		}
 		}
 	}
 	}