Commit f832ce5b001944eabb4b4256ade0e808a6da8cc6

Con Kolivas 2014-02-24T02:10:01

Set master and copy cgpu hash clock rate for hfa when dropping it on a restart.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index 624a2e1..bf3051e 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -1400,18 +1400,17 @@ static void hfa_running_shutdown(struct cgpu_info *hashfast, struct hashfast_inf
 		return;
 
 	if (info->hash_clock_rate > HFA_CLOCK_DEFAULT) {
-		struct hashfast_info *cinfo;
-
-		/* Set the master device's clock speed if this is a copy */
-		if (info->old_cgpu && info->old_cgpu->device_data)
-			cinfo = info->old_cgpu->device_data;
-		else
-			cinfo = info;
-		cinfo->hash_clock_rate -= 10;
-		if (cinfo->hash_clock_rate < HFA_CLOCK_DEFAULT)
-			cinfo->hash_clock_rate = HFA_CLOCK_DEFAULT;
+		info->hash_clock_rate -= 10;
+		if (info->hash_clock_rate < HFA_CLOCK_DEFAULT)
+			info->hash_clock_rate = HFA_CLOCK_DEFAULT;
+		if (info->old_cgpu && info->old_cgpu->device_data) {
+			struct hashfast_info *cinfo = info->old_cgpu->device_data;
+
+			/* Set the master device's clock speed if this is a copy */
+			cinfo->hash_clock_rate = info->hash_clock_rate;
+		}
 		applog(LOG_WARNING, "%s %d: Decreasing clock speed to %d with reset",
-			hashfast->drv->name, hashfast->device_id, cinfo->hash_clock_rate);
+			hashfast->drv->name, hashfast->device_id, info->hash_clock_rate);
 	}
 
 	if (!hfa_send_shutdown(hashfast))