mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Simplify debugging and only discard from avalon read buffer if at least one full result has been discarded.
This commit is contained in:
parent
7324a33b55
commit
fba70ff593
@ -650,23 +650,24 @@ static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *i
|
|||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
spare = *offset - AVALON_READ_SIZE;
|
spare = *offset - AVALON_READ_SIZE;
|
||||||
if (spare)
|
/* We are buffering and haven't accumulated one more corrupt
|
||||||
|
* work result. */
|
||||||
|
if (spare < (int)AVALON_READ_SIZE)
|
||||||
|
return;
|
||||||
applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", spare);
|
applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", spare);
|
||||||
|
|
||||||
|
inc_hw_errors(thr);
|
||||||
|
mutex_lock(&info->lock);
|
||||||
|
info->no_matching_work++;
|
||||||
|
mutex_unlock(&info->lock);
|
||||||
} else {
|
} else {
|
||||||
spare = AVALON_READ_SIZE + i;
|
spare = AVALON_READ_SIZE + i;
|
||||||
if (i)
|
if (i)
|
||||||
applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", i);
|
applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", i);
|
||||||
}
|
}
|
||||||
if (spare) {
|
|
||||||
*offset -= spare;
|
*offset -= spare;
|
||||||
memmove(buf, buf + spare, *offset);
|
memmove(buf, buf + spare, *offset);
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
mutex_lock(&info->lock);
|
|
||||||
info->no_matching_work++;
|
|
||||||
mutex_unlock(&info->lock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *avalon_get_results(void *userdata)
|
static void *avalon_get_results(void *userdata)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user