|
|
@ -156,7 +156,7 @@ static void biforce_clear_buffer(struct cgpu_info *bitforce) |
|
|
|
void bitforce_init(struct cgpu_info *bitforce) |
|
|
|
void bitforce_init(struct cgpu_info *bitforce) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char *devpath = bitforce->device_path; |
|
|
|
char *devpath = bitforce->device_path; |
|
|
|
int fdDev = bitforce->device_fd; |
|
|
|
int fdDev = bitforce->device_fd, retries = 0; |
|
|
|
char pdevbuf[0x100]; |
|
|
|
char pdevbuf[0x100]; |
|
|
|
char *s; |
|
|
|
char *s; |
|
|
|
|
|
|
|
|
|
|
@ -185,7 +185,10 @@ void bitforce_init(struct cgpu_info *bitforce) |
|
|
|
applog(LOG_ERR, "BFL%i: Error reading (ZGX)", bitforce->device_id); |
|
|
|
applog(LOG_ERR, "BFL%i: Error reading (ZGX)", bitforce->device_id); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} while (!strstr(pdevbuf, "BUSY")); |
|
|
|
|
|
|
|
|
|
|
|
if (retries++) |
|
|
|
|
|
|
|
usleep(10000); |
|
|
|
|
|
|
|
} while (!strstr(pdevbuf, "BUSY") && (retries * 10 < BITFORCE_TIMEOUT_MS)); |
|
|
|
|
|
|
|
|
|
|
|
if (unlikely(!strstr(pdevbuf, "SHA256"))) { |
|
|
|
if (unlikely(!strstr(pdevbuf, "SHA256"))) { |
|
|
|
mutex_unlock(&bitforce->device_mutex); |
|
|
|
mutex_unlock(&bitforce->device_mutex); |
|
|
|