Only perform a hfa fan speed update if we have new temps to work with.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
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;