1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Limit retrying on busy for up to BITFORCE_TIMEOUT_MS

This commit is contained in:
Con Kolivas 2012-07-04 16:58:08 +10:00
parent 7046c976bc
commit a9746b9f5e

View File

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