|
|
@ -929,13 +929,18 @@ static int64_t avalon_scanhash(struct thr_info *thr) |
|
|
|
elapsed.tv_sec, elapsed.tv_usec); |
|
|
|
elapsed.tv_sec, elapsed.tv_usec); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (unlikely(result_wrong >= avalon_get_work_count || |
|
|
|
if (hash_count) { |
|
|
|
(hash_count == 0 && ret != AVA_GETS_RESTART))) { |
|
|
|
if (avalon->results < AVALON_ARRAY_SIZE) |
|
|
|
/* This means FPGA controller gave all wrong results, so
|
|
|
|
avalon->results++; |
|
|
|
* try to reset the Avalon */ |
|
|
|
} else if (unlikely((result_wrong >= avalon_get_work_count ) || |
|
|
|
|
|
|
|
(ret != AVA_GETS_RESTART && --avalon->results < 0))) { |
|
|
|
|
|
|
|
/* Look for all invalid results, or consecutive failure
|
|
|
|
|
|
|
|
* to generate any results suggesting the FPGA |
|
|
|
|
|
|
|
* controller has screwed up. */ |
|
|
|
do_avalon_close(thr); |
|
|
|
do_avalon_close(thr); |
|
|
|
applog(LOG_ERR, |
|
|
|
applog(LOG_ERR, |
|
|
|
"AVA%i: FPGA controller mess up, %d wrong results", avalon->device_id, result_wrong); |
|
|
|
"AVA%i: FPGA controller messed up, %d wrong results", |
|
|
|
|
|
|
|
avalon->device_id, result_wrong); |
|
|
|
dev_error(avalon, REASON_DEV_COMMS_ERROR); |
|
|
|
dev_error(avalon, REASON_DEV_COMMS_ERROR); |
|
|
|
sleep(1); |
|
|
|
sleep(1); |
|
|
|
avalon_init(avalon); |
|
|
|
avalon_init(avalon); |
|
|
|