Browse Source

Limit retrying on busy for up to BITFORCE_TIMEOUT_MS

nfactor-troky
Con Kolivas 13 years ago
parent
commit
a9746b9f5e
  1. 7
      driver-bitforce.c

7
driver-bitforce.c

@ -156,7 +156,7 @@ static void biforce_clear_buffer(struct cgpu_info *bitforce) @@ -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) @@ -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);

Loading…
Cancel
Save