Commit bd6bc6bd23424958ebf1d49f22d6a50070d13d23

Con Kolivas 2013-06-13T16:13:52

Decrease the sleep duration before reading in avalon to not let the read buffer overflow.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/driver-avalon.c b/driver-avalon.c
index c5c95f8..367f5a5 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -242,9 +242,10 @@ static int avalon_read(struct cgpu_info *avalon, unsigned char *buf,
 	int err, amount, ofs = 2, cp;
 
 	/* If the buffer is ready to take more work, yield once in case the
-	 * write thread is waiting to be scheduled. */
+	 * write thread is waiting to be scheduled. Keep it under the time
+	 * it would take to fill the entire 512 byte buffer. */
 	if (!avalon_buffer_full(avalon))
-		nmsleep(40);
+		nmsleep(32);
 
 	err = usb_read_once_timeout(avalon, readbuf, readsize, &amount, timeout, ep);
 	applog(LOG_DEBUG, "%s%i: Get avalon read got err %d",