Commit a2846cba2eb9672a1614a46c874e70305ad9e252

Con Kolivas 2014-01-25T20:34:19

Set the global hfa hash clock rate to equal the lowest if we are lowering it for a device reset since it may be re-hotplugged after failing reset.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 6a8ca49..223a4cc 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -936,6 +936,8 @@ static int64_t hfa_scanwork(struct thr_info *thr)
 		       hashfast->device_id);
 		if (info->hash_clock_rate > HFA_CLOCK_DEFAULT) {
 			info->hash_clock_rate -= 5;
+			if (info->hash_clock_rate < opt_hfa_hash_clock)
+				opt_hfa_hash_clock = info->hash_clock_rate;
 			applog(LOG_WARNING, "%s %d: Decreasing clock speed to %d with reset",
 			       hashfast->drv->name, hashfast->device_id, info->hash_clock_rate);
 		}