Browse Source

Merge commit 'c3e3227' into bfgminer

Conflicts:
	driver-bitforce.c
Luke Dashjr 13 years ago
parent
commit
d6d9778cef
3 changed files with 6 additions and 47 deletions
  1. 3 23
      driver-bitforce.c
  2. 3 23
      miner.c
  3. 0 1
      miner.h

+ 3 - 23
driver-bitforce.c

@@ -612,7 +612,6 @@ static void biforce_thread_enable(struct thr_info *thr)
 static int64_t bitforce_scanhash(struct thr_info *thr, struct work *work, int64_t __maybe_unused max_nonce)
 {
 	struct cgpu_info *bitforce = thr->cgpu;
-	unsigned int sleep_time;
 	int64_t ret;
 
 	if (!bitforce_send_work(thr, work)) {
@@ -622,29 +621,10 @@ static int64_t bitforce_scanhash(struct thr_info *thr, struct work *work, int64_
 		goto commerr;
 	}
 
-	if (!bitforce->nonce_range) {
-		/* Initially wait 2/3 of the average cycle time so we can request more
-		work before full scan is up */
-		sleep_time = (2 * bitforce->sleep_ms) / 3;
-		if (noisy_stale_wait(sleep_time, work, true))
-			return 0;
-
-		bitforce->wait_ms = sleep_time;
-		queue_request(thr, false);
-
-		/* Now wait athe final 1/3rd; no bitforce should be finished by now */
-		sleep_time = bitforce->sleep_ms - sleep_time;
-		if (noisy_stale_wait(sleep_time, work, true))
-			return 0;
-
-		bitforce->wait_ms += sleep_time;
-	} else {
-		sleep_time = bitforce->sleep_ms;
-		if (noisy_stale_wait(sleep_time, work, true))
-			return 0;
+	if (noisy_stale_wait(bitforce->sleep_ms, work, true))
+		return 0;
 
-		bitforce->wait_ms = sleep_time;
-	}
+	bitforce->wait_ms = bitforce->sleep_ms;
 
 	{
 		bitforce->polling = true;

+ 3 - 23
miner.c

@@ -2886,6 +2886,8 @@ static struct pool *priority_pool(int choice)
 	return ret;
 }
 
+static bool queue_request(struct thr_info *thr, bool needed);
+
 void switch_pools(struct pool *selected)
 {
 	struct pool *pool, *last_pool;
@@ -2976,8 +2978,6 @@ static void discard_work(struct work *work)
 	free_work(work);
 }
 
-bool queue_request(struct thr_info *thr, bool needed);
-
 static void discard_stale(void)
 {
 	struct work *work, *tmp;
@@ -3084,8 +3084,6 @@ static void restart_threads(void)
 	/* Discard staged work that is now stale */
 	discard_stale();
 
-	queue_request(NULL, true);
-
 	for (i = 0; i < mining_threads; i++)
 	{
 		thr = &thr_info[i];
@@ -4336,7 +4334,7 @@ static void pool_resus(struct pool *pool)
 		switch_pools(NULL);
 }
 
-bool queue_request(struct thr_info *thr, bool needed)
+static bool queue_request(struct thr_info *thr, bool needed)
 {
 	struct workio_cmd *wc;
 
@@ -4785,22 +4783,6 @@ void *miner_thread(void *userdata)
 			}
 
 			timersub(&tv_end, &tv_workstart, &wdiff);
-			if (!requested) {
-				if (wdiff.tv_sec > request_interval || work->blk.nonce > request_nonce) {
-					thread_reportout(mythr);
-					if (unlikely(!queue_request(mythr, false))) {
-						applog(LOG_ERR, "Failed to queue_request in miner_thread %d", thr_id);
-
-						cgpu->device_last_not_well = time(NULL);
-						cgpu->device_not_well_reason = REASON_THREAD_FAIL_QUEUE;
-						cgpu->thread_fail_queue_count++;
-
-						goto out;
-					}
-					thread_reportin(mythr);
-					requested = true;
-				}
-			}
 
 			if (unlikely((long)sdiff.tv_sec < cycle)) {
 				int mult;
@@ -5174,8 +5156,6 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 
 		discard_stale();
 
-		queue_request(NULL, false);
-
 		hashmeter(-1, &zero_tv, 0);
 
 #ifdef HAVE_CURSES

+ 0 - 1
miner.h

@@ -654,7 +654,6 @@ extern pthread_mutex_t restart_lock;
 extern pthread_cond_t restart_cond;
 
 extern void thread_reportin(struct thr_info *thr);
-extern bool queue_request(struct thr_info *thr, bool needed);
 extern int restart_wait(unsigned int mstime);
 extern int stale_wait(unsigned int mstime, struct work*, bool checkend);