Browse Source

bitfury: Report bad nonces properly

Luke Dashjr 12 years ago
parent
commit
54db5a37ec
4 changed files with 6 additions and 5 deletions
  1. 2 1
      driver-bitfury.c
  2. 1 1
      driver-littlefury.c
  3. 2 2
      libbitfury.c
  4. 1 1
      libbitfury.h

+ 2 - 1
driver-bitfury.c

@@ -121,6 +121,7 @@ int64_t bitfury_scanHash(struct thr_info *thr)
 	for (proc = cgpu; proc; proc = proc->next_proc)
 	{
 		const int chip = proc->proc_id;
+		pthr = proc->thr[0];
 		bitfury = proc->device_data;
 		
 		bitfury->job_switched = 0;
@@ -132,7 +133,7 @@ int64_t bitfury_scanHash(struct thr_info *thr)
 		}
 		
 		payload_to_atrvec(bitfury->atrvec, &bitfury->payload);
-		libbitfury_sendHashData1(chip, bitfury);
+		libbitfury_sendHashData1(chip, bitfury, pthr);
 	}
 
 	cgsleep_ms(5);

+ 1 - 1
driver-littlefury.c

@@ -361,7 +361,7 @@ bool littlefury_do_io(struct thr_info *thr)
 	struct cgpu_info * const proc = thr->cgpu;
 	struct bitfury_device * const bitfury = proc->device_data;
 	bitfury->results_n = 0;
-	libbitfury_sendHashData1(proc->proc_id, bitfury);
+	libbitfury_sendHashData1(proc->proc_id, bitfury, thr);
 	if (bitfury->job_switched && thr->next_work)
 	{
 		mt_job_transition(thr);

+ 2 - 2
libbitfury.c

@@ -406,7 +406,7 @@ void payload_to_atrvec(uint32_t *atrvec, struct bitfury_payload *p)
 	ms3_compute(atrvec);
 }
 
-void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d)
+void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d, struct thr_info *thr)
 {
 	struct spi_port *port = d->spi;
 	unsigned *newbuf = d->newbuf;
@@ -485,7 +485,7 @@ void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d)
 					found++;
 				}
 				if (!found) {
-					applog(LOG_WARNING, "AAA Strange: %08x, chip_id: %d", pn, chip_id);
+					inc_hw_errors2(thr, NULL, &pn);
 				}
 			}
 		}

+ 1 - 1
libbitfury.h

@@ -58,7 +58,7 @@ struct bitfury_device {
 };
 
 int libbitfury_readHashData(unsigned int *res);
-extern void libbitfury_sendHashData1(int chip_id, struct bitfury_device *d);
+extern void libbitfury_sendHashData1(int chip_id, struct bitfury_device *, struct thr_info *);
 void work_to_payload(struct bitfury_payload *p, struct work *w);
 extern void payload_to_atrvec(uint32_t *atrvec, struct bitfury_payload *);
 struct timespec t_diff(struct timespec start, struct timespec end);