mirror of
https://github.com/GOSTSec/sgminer
synced 2025-09-09 12:42:05 +00:00
Count missing work items from behind a successful work read in avalon as well.
This commit is contained in:
parent
70a3e885e0
commit
4784ecce75
@ -616,6 +616,17 @@ static struct work *avalon_valid_result(struct cgpu_info *avalon, struct avalon_
|
|||||||
static void avalon_update_temps(struct cgpu_info *avalon, struct avalon_info *info,
|
static void avalon_update_temps(struct cgpu_info *avalon, struct avalon_info *info,
|
||||||
struct avalon_result *ar);
|
struct avalon_result *ar);
|
||||||
|
|
||||||
|
static void avalon_inc_nvw(struct avalon_info *info, struct thr_info *thr)
|
||||||
|
{
|
||||||
|
applog(LOG_WARNING, "%s%d: No valid work - HW error",
|
||||||
|
thr->cgpu->drv->name, thr->cgpu->device_id);
|
||||||
|
|
||||||
|
inc_hw_errors(thr);
|
||||||
|
mutex_lock(&info->lock);
|
||||||
|
info->no_matching_work++;
|
||||||
|
mutex_unlock(&info->lock);
|
||||||
|
}
|
||||||
|
|
||||||
static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *info,
|
static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *info,
|
||||||
struct thr_info *thr, char *buf, int *offset)
|
struct thr_info *thr, char *buf, int *offset)
|
||||||
{
|
{
|
||||||
@ -654,18 +665,16 @@ static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *i
|
|||||||
* work result. */
|
* work result. */
|
||||||
if (spare < (int)AVALON_READ_SIZE)
|
if (spare < (int)AVALON_READ_SIZE)
|
||||||
return;
|
return;
|
||||||
applog(LOG_WARNING, "%s%d: No valid work - HW error",
|
avalon_inc_nvw(info, thr);
|
||||||
thr->cgpu->drv->name, thr->cgpu->device_id);
|
|
||||||
|
|
||||||
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) {
|
||||||
|
if (i >= (int)AVALON_READ_SIZE)
|
||||||
|
avalon_inc_nvw(info, thr);
|
||||||
|
else
|
||||||
applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", i);
|
applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*offset -= spare;
|
*offset -= spare;
|
||||||
memmove(buf, buf + spare, *offset);
|
memmove(buf, buf + spare, *offset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user