1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-25 22:14:36 +00:00

Reset the other auto counters in avalon when idling a device.

This commit is contained in:
Con Kolivas 2013-06-26 21:46:58 +10:00
parent 9f15a08f2a
commit 18f9112e48

View File

@ -846,6 +846,13 @@ static void avalon_dec_freq(struct avalon_info *info)
info->frequency, info->timeout); 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) static void *avalon_send_tasks(void *userdata)
{ {
struct cgpu_info *avalon = (struct cgpu_info *)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) else if (info->auto_hw * 66 > total)
avalon_dec_freq(info); avalon_dec_freq(info);
} }
info->auto_queued = avalon_reset_auto(info);
info->auto_nonces =
info->auto_hw = 0;
mutex_unlock(&info->lock); mutex_unlock(&info->lock);
} }
@ -907,7 +912,7 @@ static void *avalon_send_tasks(void *userdata)
info->miner_count, 1, 1, info->frequency); info->miner_count, 1, 1, info->frequency);
/* Reset the auto_queued count if we end up /* Reset the auto_queued count if we end up
* idling any miners. */ * idling any miners. */
info->auto_queued = 0; avalon_reset_auto(info);
} }
ret = avalon_send_task(&at, avalon); ret = avalon_send_task(&at, avalon);