From 18f9112e48ac81be9164a8f526ed6d9fca8f8ed9 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 26 Jun 2013 21:46:58 +1000 Subject: [PATCH] Reset the other auto counters in avalon when idling a device. --- driver-avalon.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/driver-avalon.c b/driver-avalon.c index 4efc7832..c2c8af43 100644 --- a/driver-avalon.c +++ b/driver-avalon.c @@ -846,6 +846,13 @@ static void avalon_dec_freq(struct avalon_info *info) info->frequency, info->timeout); } +static void avalon_reset_auto(struct avalon_info *info) +{ + info->auto_queued = + info->auto_nonces = + info->auto_hw = 0; +} + static void *avalon_send_tasks(void *userdata) { struct cgpu_info *avalon = (struct cgpu_info *)userdata; @@ -876,9 +883,7 @@ static void *avalon_send_tasks(void *userdata) else if (info->auto_hw * 66 > total) avalon_dec_freq(info); } - info->auto_queued = - info->auto_nonces = - info->auto_hw = 0; + avalon_reset_auto(info); mutex_unlock(&info->lock); } @@ -907,7 +912,7 @@ static void *avalon_send_tasks(void *userdata) info->miner_count, 1, 1, info->frequency); /* Reset the auto_queued count if we end up * idling any miners. */ - info->auto_queued = 0; + avalon_reset_auto(info); } ret = avalon_send_task(&at, avalon);