Reset the work_restart bool after the scanwork loop in case the driver flushes work synchronously.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/cgminer.c b/cgminer.c
index 8be273e..62a4789 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6631,12 +6631,16 @@ void hash_queued_work(struct thr_info *mythr)
struct timeval diff;
int64_t hashes;
- mythr->work_restart = mythr->work_update = false;
+ mythr->work_update = false;
fill_queue(mythr, cgpu, drv, thr_id);
hashes = drv->scanwork(mythr);
+ /* Reset the bool here in case the driver looks for it
+ * synchronously in the scanwork loop. */
+ mythr->work_restart = false;
+
if (unlikely(hashes == -1 )) {
applog(LOG_ERR, "%s %d failure, disabling!", drv->name, cgpu->device_id);
cgpu->deven = DEV_DISABLED;
@@ -6680,10 +6684,14 @@ void hash_driver_work(struct thr_info *mythr)
struct timeval diff;
int64_t hashes;
- mythr->work_restart = mythr->work_update = false;
+ mythr->work_update = false;
hashes = drv->scanwork(mythr);
+ /* Reset the bool here in case the driver looks for it
+ * synchronously in the scanwork loop. */
+ mythr->work_restart = false;
+
if (unlikely(hashes == -1 )) {
applog(LOG_ERR, "%s %d failure, disabling!", drv->name, cgpu->device_id);
cgpu->deven = DEV_DISABLED;