Browse Source

Revert "ztex: Silence false "unexpected" hardware errors"

This reverts commit ee4802e1c9c4871cf587b93e2ff579995e7cc1a6.
Luke Dashjr 13 years ago
parent
commit
5188eab00e
3 changed files with 5 additions and 14 deletions
  1. 0 8
      driver-ztex.c
  2. 4 5
      miner.c
  3. 1 1
      miner.h

+ 0 - 8
driver-ztex.c

@@ -389,13 +389,6 @@ static void ztex_shutdown(struct thr_info *thr)
 	libztex_destroy_device(ztex);
 }
 
-static bool ztex_silence_hwerr(__maybe_unused struct thr_info *thr)
-{
-	// Current code has a false hw error for every real nonce
-	// At least silence these by pretending we handle them internally
-	return true;
-}
-
 static void ztex_disable(struct thr_info *thr)
 {
 	applog(LOG_ERR, "%s: Disabling!", thr->cgpu->device_ztex->repr);
@@ -411,6 +404,5 @@ struct device_api ztex_api = {
 	.get_api_extra_device_status = get_ztex_api_extra_device_status,
 	.thread_init = ztex_prepare,
 	.scanhash = ztex_scanhash,
-	.hw_error = ztex_silence_hwerr,
 	.thread_shutdown = ztex_shutdown,
 };

+ 4 - 5
miner.c

@@ -6153,14 +6153,13 @@ bool submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce)
 		case TNR_BAD:
 		{
 			struct cgpu_info *cgpu = thr->cgpu;
-			struct device_api *dapi = cgpu->api;
-
+			applog(LOG_WARNING, "%s %u: invalid nonce - HW error",
+			       cgpu->api->name, cgpu->device_id);
 			++hw_errors;
 			++thr->cgpu->hw_errors;
 
-			if (!(dapi->hw_error && dapi->hw_error(thr)))
-				applog(LOG_WARNING, "%s %u: invalid nonce - HW error",
-				       dapi->name, cgpu->device_id);
+			if (thr->cgpu->api->hw_error)
+				thr->cgpu->api->hw_error(thr);
 
 			return false;
 		}

+ 1 - 1
miner.h

@@ -313,7 +313,7 @@ struct device_api {
 	void (*free_work)(struct thr_info*, struct work*);
 	bool (*prepare_work)(struct thr_info*, struct work*);
 	int64_t (*scanhash)(struct thr_info*, struct work*, int64_t);
-	bool (*hw_error)(struct thr_info*);
+	void (*hw_error)(struct thr_info*);
 	void (*thread_shutdown)(struct thr_info*);
 	void (*thread_enable)(struct thr_info*);
 };