1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-10 12:41:02 +00:00

Lock qlock mutex during reset from read thread in avalon to prevent more work being sent till the reset is over.

This commit is contained in:
Con Kolivas 2013-05-27 01:32:31 +10:00
parent 499b25068c
commit f164446282

View File

@ -691,9 +691,13 @@ static void *avalon_get_results(void *userdata)
if (unlikely(avalon->results <= -info->miner_count)) { if (unlikely(avalon->results <= -info->miner_count)) {
applog(LOG_ERR, "AVA%d: %d invalid consecutive results, resetting", applog(LOG_ERR, "AVA%d: %d invalid consecutive results, resetting",
avalon->device_id, -avalon->results); avalon->device_id, -avalon->results);
/* Lock to prevent more work being sent during reset */
mutex_lock(&info->qlock);
avalon_reset(avalon, fd); avalon_reset(avalon, fd);
avalon_idle(avalon, info, fd); avalon_idle(avalon, info, fd);
avalon->results = 0; avalon->results = 0;
mutex_unlock(&info->qlock);
} }
if (unlikely(offset + rsize >= AVALON_READBUF_SIZE)) { if (unlikely(offset + rsize >= AVALON_READBUF_SIZE)) {