mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 22:14:36 +00:00
Avalon_wait_write is not effective during resets so do it after going idle.
This commit is contained in:
parent
4794ce702e
commit
ff44696a20
@ -404,6 +404,7 @@ static void avalon_idle(struct cgpu_info *avalon, int fd)
|
|||||||
struct avalon_task at;
|
struct avalon_task at;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
avalon_clear_readbuf(fd);
|
||||||
if (unlikely(avalon_buffer_full(fd))) {
|
if (unlikely(avalon_buffer_full(fd))) {
|
||||||
applog(LOG_WARNING, "Avalon buffer full in avalon_idle after %d tasks", i);
|
applog(LOG_WARNING, "Avalon buffer full in avalon_idle after %d tasks", i);
|
||||||
break;
|
break;
|
||||||
@ -426,11 +427,6 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
|
|||||||
int ret, i = 0;
|
int ret, i = 0;
|
||||||
struct timespec p;
|
struct timespec p;
|
||||||
|
|
||||||
if (!avalon_wait_write(fd)) {
|
|
||||||
applog(LOG_WARNING, "Avalon not ready for writes in avalon_reset");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reset once, then send command to go idle */
|
/* Reset once, then send command to go idle */
|
||||||
ret = avalon_write(fd, &reset, 1);
|
ret = avalon_write(fd, &reset, 1);
|
||||||
if (unlikely(ret == AVA_SEND_ERROR))
|
if (unlikely(ret == AVA_SEND_ERROR))
|
||||||
@ -443,9 +439,6 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
|
|||||||
p.tv_nsec = AVALON_RESET_PITCH;
|
p.tv_nsec = AVALON_RESET_PITCH;
|
||||||
nanosleep(&p, NULL);
|
nanosleep(&p, NULL);
|
||||||
avalon_idle(avalon, fd);
|
avalon_idle(avalon, fd);
|
||||||
avalon_wait_write(fd);
|
|
||||||
avalon_clear_readbuf(fd);
|
|
||||||
applog(LOG_ERR, "Avalon: Idle");
|
|
||||||
|
|
||||||
/* Reset again, then check result */
|
/* Reset again, then check result */
|
||||||
ret = avalon_write(fd, &reset, 1);
|
ret = avalon_write(fd, &reset, 1);
|
||||||
@ -475,6 +468,8 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
|
|||||||
applog(LOG_WARNING, "Avalon: Reset succeeded");
|
applog(LOG_WARNING, "Avalon: Reset succeeded");
|
||||||
|
|
||||||
avalon_idle(avalon, fd);
|
avalon_idle(avalon, fd);
|
||||||
|
if (!avalon_wait_write(fd))
|
||||||
|
applog(LOG_WARNING, "Avalon: Not ready for writes?");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user