From e90cf62af123d7e78e7ccd08e6046309f372b132 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 26 May 2013 17:07:27 +1000 Subject: [PATCH] Unset the work restart flag sooner in avalon_flush_work to avoid re-entering the flush work function and just reset the queued counter instead of rotating the array to avoid runs of no valid work. --- driver-avalon.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/driver-avalon.c b/driver-avalon.c index 06a15c76..c9ad8fae 100644 --- a/driver-avalon.c +++ b/driver-avalon.c @@ -972,12 +972,13 @@ static void avalon_flush_work(struct cgpu_info *avalon) struct avalon_info *info = avalon->device_data; struct thr_info *thr = info->thr; + thr->work_restart = false; + mutex_lock(&info->qlock); - avalon_rotate_array(avalon); + /* Will overwrite any work queued */ + avalon->queued = 0; pthread_cond_signal(&info->qcond); mutex_unlock(&info->qlock); - - thr->work_restart = false; } static struct api_data *avalon_api_stats(struct cgpu_info *cgpu)