Allow throttling of hfa dies more frequently and increasing of speeds less frequently.
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 43 44 45
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 1b73e76..4db7572 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -1136,7 +1136,7 @@ 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_updates < 5)
- goto fan_only;
+ goto dies_only;
info->temp_updates = 0;
temp_change = info->max_temp - info->last_max_temp;
info->last_max_temp = info->max_temp;
@@ -1168,7 +1168,7 @@ static void hfa_temp_clock(struct cgpu_info *hashfast, struct hashfast_info *inf
}
}
-fan_only:
+dies_only:
/* Do no restarts at all if there has been one less than 15 seconds
* ago */
if (now_t - info->last_restart < 15)
@@ -1178,10 +1178,6 @@ fan_only:
int die = (info->last_die_adjusted + i) % info->asic_count;
struct hf_die_data *hdd = &info->die_data[die];
- /* Only send a restart no more than every 30 seconds. */
- if (now_t - hdd->last_restart < 30)
- continue;
-
/* Sanity check */
if (unlikely(hdd->temp == 0.0 || hdd->temp > 255))
continue;
@@ -1201,7 +1197,10 @@ fan_only:
break;
hfa_decrease_clock(hashfast, info, die);
} else {
- /* Temp below target range.*/
+ /* Temp below target range. Only send a restart to
+ * increase speed no more than every 60 seconds. */
+ if (now_t - hdd->last_restart < 60)
+ continue;
/* Already at max speed */
if (hdd->hash_clock == info->hash_clock_rate)