Browse Source

modminer: HACK: Let last_work handle the end of the work, and start the next one immediately

For some reason, work changes are delayed a bit
Luke Dashjr 13 years ago
parent
commit
14c68bd59c
1 changed files with 10 additions and 0 deletions
  1. 10 0
      driver-modminer.c

+ 10 - 0
driver-modminer.c

@@ -457,7 +457,10 @@ modminer_process_results(struct thr_info*thr)
 
 
 	uint64_t hashes = (uint64_t)state->clock * (((uint64_t)elapsed.tv_sec * 1000000) + elapsed.tv_usec);
 	uint64_t hashes = (uint64_t)state->clock * (((uint64_t)elapsed.tv_sec * 1000000) + elapsed.tv_usec);
 	if (hashes > 0xffffffff)
 	if (hashes > 0xffffffff)
+	{
+		applog(LOG_WARNING, "%s %u.%u: Finished work before new one sent", modminer->api->name, modminer->device_id, fpgaid);
 		hashes = 0xffffffff;
 		hashes = 0xffffffff;
+	}
 	if (hashes <= state->hashes)
 	if (hashes <= state->hashes)
 		hashes = 1;
 		hashes = 1;
 	else
 	else
@@ -474,6 +477,13 @@ modminer_scanhash(struct thr_info*thr, struct work*work, uint64_t __maybe_unused
 	bool startwork;
 	bool startwork;
 
 
 	startwork = modminer_prepare_next_work(state, work);
 	startwork = modminer_prepare_next_work(state, work);
+	if (startwork) {
+		/* HACK: For some reason, this is delayed a bit
+		 *       Let last_work handle the end of the work,
+		 *       and start the next one immediately
+		 */
+	}
+	else
 	if (state->work_running) {
 	if (state->work_running) {
 		hashes = modminer_process_results(thr);
 		hashes = modminer_process_results(thr);
 		if (work_restart(thr)) {
 		if (work_restart(thr)) {