Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Decrease the sleep duration before reading in avalon to not let the r…
Browse files Browse the repository at this point in the history
…ead buffer overflow.
  • Loading branch information
ckolivas committed Jun 13, 2013
1 parent 13a4aaa commit bd6bc6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions driver-avalon.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ static int avalon_read(struct cgpu_info *avalon, unsigned char *buf,
int err, amount, ofs = 2, cp;

/* If the buffer is ready to take more work, yield once in case the
* write thread is waiting to be scheduled. */
* write thread is waiting to be scheduled. Keep it under the time
* it would take to fill the entire 512 byte buffer. */
if (!avalon_buffer_full(avalon))
nmsleep(40);
nmsleep(32);

err = usb_read_once_timeout(avalon, readbuf, readsize, &amount, timeout, ep);
applog(LOG_DEBUG, "%s%i: Get avalon read got err %d",
Expand Down

0 comments on commit bd6bc6b

Please sign in to comment.