Browse Source

Bugfix: bitforce: Ensure result_busy_polled gets set for queue mode to avoid unnecessary 10ms wait times

Luke Dashjr 13 years ago
parent
commit
83f4657d7d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      driver-bitforce.c

+ 4 - 2
driver-bitforce.c

@@ -721,8 +721,6 @@ void bitforce_job_get_results(struct thr_info *thr, struct work *work)
 		mutex_unlock(mutexp);
 
 		gettimeofday(&now, NULL);
-		if (!count)
-			goto noqr;
 		timersub(&now, &bitforce->work_start_tv, &elapsed);
 
 		if (elapsed.tv_sec >= BITFORCE_LONG_TIMEOUT_S) {
@@ -731,6 +729,8 @@ void bitforce_job_get_results(struct thr_info *thr, struct work *work)
 			goto out;
 		}
 
+		if (!count)
+			goto noqr;
 		if (pdevbuf[0] && strncasecmp(pdevbuf, "B", 1)) /* BFL does not respond during throttling */
 			break;
 
@@ -742,6 +742,8 @@ void bitforce_job_get_results(struct thr_info *thr, struct work *work)
 		}
 
 noqr:
+		data->result_busy_polled = bitforce->wait_ms;
+		
 		/* if BFL is throttling, no point checking so quickly */
 		delay_time_ms = (pdevbuf[0] ? BITFORCE_CHECK_INTERVAL_MS : 2 * WORK_CHECK_INTERVAL_MS);
 		timer_set_delay(&thr->tv_poll, &now, delay_time_ms * 1000);