From f97e1ad25fa9898dbaf3392731d8134b6350f94f Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 25 Sep 2013 23:54:37 +1000 Subject: [PATCH] Check for work restart, breaking out early after usb reads in BF1. --- driver-bitfury.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver-bitfury.c b/driver-bitfury.c index 46487871..d263ecdd 100644 --- a/driver-bitfury.c +++ b/driver-bitfury.c @@ -181,6 +181,8 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work, * look for the results to prev work. */ usb_read_timeout(bitfury, info->buf, 512, &amount, 600, C_BFO_GETRES); info->tot += amount; + if (unlikely(thr->work_restart)) + goto cascade; /* Now look for the bulk of the previous work results, they will come * in a batch following the first data. */ @@ -191,6 +193,9 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work, info->tot += amount; }; + if (unlikely(thr->work_restart)) + goto cascade; + /* Send work */ usb_write(bitfury, buf, 45, &amount, C_BFO_REQWORK); /* Get response acknowledging work */