Browse Source

Bugfix: bitforce: Always increment global hw error counter when incrementing device hwe

Luke Dashjr 13 years ago
parent
commit
71f85c67c3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      driver-bitforce.c

+ 4 - 0
driver-bitforce.c

@@ -300,6 +300,7 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
 	if (unlikely(!pdevbuf[0])) {
 	if (unlikely(!pdevbuf[0])) {
 		applog(LOG_ERR, "BFL%i: Error: Get temp returned empty string/timed out", bitforce->device_id);
 		applog(LOG_ERR, "BFL%i: Error: Get temp returned empty string/timed out", bitforce->device_id);
 		bitforce->hw_errors++;
 		bitforce->hw_errors++;
+		++hw_errors;
 		return false;
 		return false;
 	}
 	}
 
 
@@ -324,6 +325,7 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
 		bitforce->dev_throttle_count++;
 		bitforce->dev_throttle_count++;
 		/* Count throttling episodes as hardware errors */
 		/* Count throttling episodes as hardware errors */
 		bitforce->hw_errors++;
 		bitforce->hw_errors++;
+		++hw_errors;
 		bitforce_clear_buffer(bitforce);
 		bitforce_clear_buffer(bitforce);
 		return false;
 		return false;
 	}
 	}
@@ -508,6 +510,7 @@ static int64_t bitforce_get_result(struct thr_info *thr, struct work *work)
 		return 0;	/* Device idle */
 		return 0;	/* Device idle */
 	else if (strncasecmp(pdevbuf, "NONCE-FOUND", 11)) {
 	else if (strncasecmp(pdevbuf, "NONCE-FOUND", 11)) {
 		bitforce->hw_errors++;
 		bitforce->hw_errors++;
+		++hw_errors;
 		applog(LOG_WARNING, "BFL%i: Error: Get result reports: %s", bitforce->device_id, pdevbuf);
 		applog(LOG_WARNING, "BFL%i: Error: Get result reports: %s", bitforce->device_id, pdevbuf);
 		bitforce_clear_buffer(bitforce);
 		bitforce_clear_buffer(bitforce);
 		return 0;
 		return 0;
@@ -582,6 +585,7 @@ commerr:
 		bitforce->device_not_well_reason = REASON_DEV_COMMS_ERROR;
 		bitforce->device_not_well_reason = REASON_DEV_COMMS_ERROR;
 		bitforce->dev_comms_error_count++;
 		bitforce->dev_comms_error_count++;
 		bitforce->hw_errors++;
 		bitforce->hw_errors++;
+		++hw_errors;
 		BFclose(bitforce->device_fd);
 		BFclose(bitforce->device_fd);
 		int fd = bitforce->device_fd = BFopen(bitforce->device_path);
 		int fd = bitforce->device_fd = BFopen(bitforce->device_path);
 		if (fd == -1) {
 		if (fd == -1) {