Commit 7aa809ca241bfeafacbfbc088798b09c725231ff

Con Kolivas 2012-08-01T19:36:00

Revert "Revert "Change BFL driver thread initialising to a constant 100ms delay between devices instead of a random arrangement."" This reverts commit 89e613b94361a68305a68095b1b8f4756f9ef8f8. Leave the delay between each device initialising.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/driver-bitforce.c b/driver-bitforce.c
index 6a3f109..f7e5b3e 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -530,9 +530,9 @@ static bool bitforce_thread_init(struct thr_info *thr)
 	struct cgpu_info *bitforce = thr->cgpu;
 	unsigned int wait;
 
-	/* Pause each new thread a random time between 0-100ms 
-	so the devices aren't making calls all at the same time. */
-	wait = (rand() * MAX_START_DELAY_US)/RAND_MAX;
+	/* Pause each new thread at least 100ms between initialising
+	 * so the devices aren't making calls all at the same time. */
+	wait = thr->id * MAX_START_DELAY_US;
 	applog(LOG_DEBUG, "BFL%i: Delaying start by %dms", bitforce->device_id, wait / 1000);
 	usleep(wait);