Commit 173457fc82753d061009b90bc8102d257c0b6ad4

Con Kolivas 2014-02-04T19:13:48

Only perform a hfa fan speed update if we have new temps to work with.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index ecdf400..a0ccf03 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -705,6 +705,7 @@ static void hfa_update_die_status(struct cgpu_info *hashfast, struct hashfast_in
 		// XXX Convert board phase currents, voltage, temperature
 	}
 	if (die == info->asic_count - 1) {
+		info->temp_update = true;
 		/* We have a full set of die temperatures, find the highest
 		 * current die temp. */
 		die_temperature = 0;
@@ -1060,6 +1061,9 @@ static void hfa_temp_clock(struct cgpu_info *hashfast, struct hashfast_info *inf
 	}
 
 	/* Find the direction of temperature change since we last checked */
+	if (!info->temp_update)
+		goto fan_only;
+	info->temp_update = false;
 	temp_change = info->max_temp - info->last_max_temp;
 	info->last_max_temp = info->max_temp;
 
@@ -1090,6 +1094,7 @@ static void hfa_temp_clock(struct cgpu_info *hashfast, struct hashfast_info *inf
 		}
 	}
 
+fan_only:
 	/* Do no restarts at all if there has been one less than 15 seconds
 	 * ago */
 	if (now_t - info->last_restart < 15)
diff --git a/driver-hashfast.h b/driver-hashfast.h
index ef87b27..6dfd845 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -123,6 +123,7 @@ struct hashfast_info {
 	int overheat;
 	double max_temp;
 	int last_max_temp;
+	bool temp_update;
 	int fanspeed;                               // Fanspeed in percent
 
 	pthread_t read_thr;