Browse Source

We should break on the loop on a work restart in avalon, and only consider all errors if we actually have gotten some results.

Con Kolivas 13 years ago
parent
commit
ba1ff87356
1 changed files with 2 additions and 2 deletions
  1. 2 2
      driver-avalon.c

+ 2 - 2
driver-avalon.c

@@ -868,7 +868,7 @@ static int64_t avalon_scanhash(struct thr_info *thr, struct work **work,
 			avalon_free_work(thr, info->bulk1);
 			avalon_free_work(thr, info->bulk2);
 			avalon_free_work(thr, info->bulk3);
-			continue;
+			break;
 		}
 		result_count++;
 
@@ -908,7 +908,7 @@ static int64_t avalon_scanhash(struct thr_info *thr, struct work **work,
 			       elapsed.tv_sec, elapsed.tv_usec);
 		}
 	}
-	if (result_count == result_wrong) {
+	if (result_wrong && result_count == result_wrong) {
 		/* This mean FPGA controller give all wrong result
 		 * try to reset the Avalon */
 		avalon_free_work(thr, info->bulk0);