Commit ecc9457b6bda7626b88e308e0093884a5eec0a56

Kano 2013-08-07T21:25:33

Avalon BTB allow partial work to be transferred

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/driver-avalon.c b/driver-avalon.c
index 481d2c2..59bd058 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -984,7 +984,13 @@ static void *avalon_send_tasks(void *userdata)
 				applog(LOG_INFO,
 				       "%s%i: Buffer full after only %d of %d work queued",
 					avalon->drv->name, avalon->device_id, j, avalon_get_work_count);
-				break;
+
+					if (usb_ident(avalon) != IDENT_BTB)
+						break;
+					else {
+						while (avalon_buffer_full(avalon))
+							cgsem_wait(&info->write_sem);
+					}
 			}
 
 			if (likely(j < avalon->queued && !info->overheat && avalon->works[i])) {