Commit 9a036bc856a19ee1a47ee9c4c1290bf443afd26e

Con Kolivas 2013-11-11T18:05:57

Only retry 3 times in hfa_reset.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index 1e2744d..0b230fa 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -206,11 +206,11 @@ static bool hfa_reset(struct cgpu_info *hashfast, struct hashfast_info *info)
 	struct hf_usb_init_header usb_init, *hu = &usb_init;
 	struct hf_usb_init_base *db;
         struct hf_usb_init_options *ho;
+	int retries = 0, i;
 	char buf[1024];
 	struct hf_header *h = (struct hf_header *)buf;
 	uint8_t hcrc;
 	bool ret;
-	int i;
 
         // XXX Following items need to be defaults with command-line overrides
 	info->hash_clock_rate = 550;	// Hash clock rate in Mhz
@@ -260,7 +260,9 @@ tryagain:
 		applog(LOG_WARNING, "HFA %d: OP_USB_INIT: Tossing packet, valid but unexpected type %d",
                         hashfast->device_id, h->operation_code);
 		hfa_get_data(hashfast, buf, h->data_length);
-		goto tryagain;
+		if (retries++ < 3)
+			goto tryagain;
+		return false;
 	}
 
 	applog(LOG_DEBUG, "HFA %d: Good reply to OP_USB_INIT", hashfast->device_id);