Commit ed9a89efdeda1539a78ef54d0ca6bd8b9a103811

Con Kolivas 2013-11-23T09:59:59

Set the bitfury device start times from when we first get valid work.

diff --git a/driver-bitfury.c b/driver-bitfury.c
index fb6d44a..7181488 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -355,7 +355,11 @@ static void parse_bxf_submit(struct cgpu_info *bitfury, struct bitfury_info *inf
 		inc_hw_errors(thr);
 		return;
 	}
-	info->valid = true;
+	/* Set the device start time from when we first get valid results */
+	if (unlikely(!info->valid)) {
+		info->valid = true;
+		cgtime(&bitfury->dev_start_tv);
+	}
 	set_work_ntime(work, timestamp);
 	if (submit_nonce(thr, work, nonce)) {
 		mutex_lock(&info->lock);
@@ -617,8 +621,10 @@ out:
 		if (!found) {
 			if (likely(info->valid))
 				inc_hw_errors(thr);
-		} else
+		} else if (unlikely(!info->valid)) {
 			info->valid = true;
+			cgtime(&bitfury->dev_start_tv);
+		}
 	}
 
 	cgtime(&tv_now);