Browse Source

Merge branch 'life_init' into bfgminer

Conflicts:
	api.c
Luke Dashjr 13 years ago
parent
commit
b92588f8c3
4 changed files with 8 additions and 1 deletions
  1. 3 0
      api.c
  2. 1 0
      driver-opencl.c
  3. 2 0
      miner.c
  4. 2 1
      miner.h

+ 3 - 0
api.c

@@ -170,6 +170,7 @@ static const char *APIVERSION = "1.14";
 static const char *DEAD = "Dead";
 static const char *SICK = "Sick";
 static const char *NOSTART = "NoStart";
+static const char *INIT = "Initializing";
 static const char *DISABLED = "Disabled";
 static const char *ALIVE = "Alive";
 static const char *REJECTING = "Rejecting";
@@ -1269,6 +1270,8 @@ status2str(enum alive status)
 		return DEAD;
 	case LIFE_NOSTART:
 		return NOSTART;
+	case LIFE_INIT:
+		return INIT;
 	default:
 		return UNKNOWN;
 	}

+ 1 - 0
driver-opencl.c

@@ -856,6 +856,7 @@ retry:
 				case LIFE_DEAD:
 					wlog("DEAD reported in %s", checkin);
 					break;
+				case LIFE_INIT:
 				case LIFE_NOSTART:
 					wlog("Never started");
 					break;

+ 2 - 0
miner.c

@@ -4663,6 +4663,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 			dev_count_dead = (cgpu->low_count > WATCHDOG_DEAD_COUNT);
 
 			if (cgpu->status != LIFE_WELL && (now.tv_sec - thr->last.tv_sec < WATCHDOG_SICK_TIME) && dev_count_well) {
+				if (cgpu->status != LIFE_INIT)
 				applog(LOG_ERR, "%s: Recovered, declaring WELL!", dev_str);
 				cgpu->status = LIFE_WELL;
 				cgpu->device_last_well = time(NULL);
@@ -5516,6 +5517,7 @@ begin_bench:
 		struct cgpu_info *cgpu = devices[i];
 		cgpu->thr = calloc(cgpu->threads+1, sizeof(*cgpu->thr));
 		cgpu->thr[cgpu->threads] = NULL;
+		cgpu->status = LIFE_INIT;
 
 		// Setup thread structs before starting any of the threads, in case they try to interact
 		for (j = 0; j < cgpu->threads; ++j, ++k) {

+ 2 - 1
miner.h

@@ -159,7 +159,8 @@ enum alive {
 	LIFE_WELL,
 	LIFE_SICK,
 	LIFE_DEAD,
-	LIFE_NOSTART
+	LIFE_NOSTART,
+	LIFE_INIT,
 };