Commit f00f23b1ddf4aa12b53cb2fa20e5ab64d8bb41b6

Con Kolivas 2013-12-29T10:24:52

Make the result return rate low detection on avalon less trigger happy.

diff --git a/driver-avalon.c b/driver-avalon.c
index 32e9a39..40467ad 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -1566,8 +1566,8 @@ static int64_t avalon_scanhash(struct thr_info *thr)
 
 	mutex_lock(&info->lock);
 	hash_count = 0xffffffffull * (uint64_t)info->nonces;
-	avalon->results += info->nonces + info->idle;
-	if (avalon->results > miner_count)
+	avalon->results += info->nonces;
+	if (avalon->results > miner_count || info->idle)
 		avalon->results = miner_count;
 	if (!info->reset)
 		avalon->results--;
@@ -1580,6 +1580,7 @@ static int64_t avalon_scanhash(struct thr_info *thr)
 		if (avalon->results < -miner_count && !info->reset) {
 			applog(LOG_ERR, "%s%d: Result return rate low, resetting!",
 				avalon->drv->name, avalon->device_id);
+			avalon->results = miner_count;
 			info->reset = true;
 		}
 	}