Commit 8b0fb20839cd2b029de7310a00c314a17b9fd8b8

Con Kolivas 2014-02-24T02:00:44

Set the master hfa clock speed to lower when shutting down a copy.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index 0bd7f85..624a2e1 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -1400,11 +1400,18 @@ static void hfa_running_shutdown(struct cgpu_info *hashfast, struct hashfast_inf
 		return;
 
 	if (info->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;
+		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;
 		applog(LOG_WARNING, "%s %d: Decreasing clock speed to %d with reset",
-			hashfast->drv->name, hashfast->device_id, info->hash_clock_rate);
+			hashfast->drv->name, hashfast->device_id, cinfo->hash_clock_rate);
 	}
 
 	if (!hfa_send_shutdown(hashfast))