From a60a1b0fceec737377310eca357d28491145fe06 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 30 May 2013 16:35:58 +1000 Subject: [PATCH] Break out of idling loop in avalon_idle if the buffer is full. --- driver-avalon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver-avalon.c b/driver-avalon.c index a064b759..4136e49e 100644 --- a/driver-avalon.c +++ b/driver-avalon.c @@ -465,17 +465,18 @@ static void avalon_idle(struct cgpu_info *avalon, struct avalon_info *info) info->idle = true; wait_avalon_ready(avalon); - applog(LOG_WARNING, "AVA%i: Idling %d miners", avalon->device_id, - info->miner_count); /* Send idle to all miners */ for (i = 0; i < info->miner_count; i++) { struct avalon_task at; + if (unlikely(avalon_buffer_full(avalon))) + break; avalon_init_task(&at, 0, 0, info->fan_pwm, info->timeout, info->asic_count, info->miner_count, 1, 1, info->frequency); avalon_send_task(&at, avalon); } + applog(LOG_WARNING, "AVA%i: Idling %d miners", avalon->device_id, i); wait_avalon_ready(avalon); }