diff --git a/driver-avalon.c b/driver-avalon.c index b263d0ad..959b43ee 100644 --- a/driver-avalon.c +++ b/driver-avalon.c @@ -771,15 +771,17 @@ static inline void adjust_fan(struct avalon_info *info) static bool avalon_fill(struct cgpu_info *avalon) { + int subid, mc = avalon_infos[avalon->device_id]->miner_count; struct work *work; - int mc = avalon_infos[avalon->device_id]->miner_count; if (avalon->queued >= mc) return true; work = get_queued(avalon); if (unlikely(!work)) return false; - avalon->works[avalon->work_array * mc + avalon->queued++] = work; + subid = avalon->queued++; + work->subid = subid; + avalon->works[avalon->work_array * mc + subid] = work; if (avalon->queued >= mc) return true; return false;