Commit 855d1bb3e33dd2c12f7edbfe3dd7dfab6a9de03e

Paul Sheppard 2012-07-01T17:35:53

Add busy time to wait time.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/driver-bitforce.c b/driver-bitforce.c
index af6989e..4a60872 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -255,9 +255,10 @@ re_send:
 		applog(LOG_ERR, "BFL%i: Error: Send work returned empty string", bitforce->device_id);
 		mutex_unlock(&bitforce->device_mutex);
 		return false;
-	} else if (pdevbuf[0] == 'B'){
+	} else if (pdevbuf[0] == 'B') {
 		applog(LOG_DEBUG, "BFL%i: Busy", bitforce->device_id);
 		mutex_unlock(&bitforce->device_mutex);
+		bitforce->wait_ms += BITFORCE_CHECK_INTERVAL_MS;
 		usleep(BITFORCE_CHECK_INTERVAL_MS*1000);
 		goto re_send;
 	} else if (unlikely(pdevbuf[0] != 'O' || pdevbuf[1] != 'K')) {