mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 14:28:12 +00:00
Treat usb write timeout errors as unrecoverable.
This commit is contained in:
parent
42b3cf19c4
commit
6bc691adb2
@ -22,6 +22,9 @@
|
|||||||
(err) == LIBUSB_ERROR_PIPE || \
|
(err) == LIBUSB_ERROR_PIPE || \
|
||||||
(err) == LIBUSB_ERROR_OTHER)
|
(err) == LIBUSB_ERROR_OTHER)
|
||||||
|
|
||||||
|
/* Timeout errors on writes are basically unrecoverable */
|
||||||
|
#define WRITENODEV(err) ((err) == LIBUSB_ERROR_TIMEOUT || NODEV(err))
|
||||||
|
|
||||||
#define NOCONTROLDEV(err) ((err) == LIBUSB_ERROR_NO_DEVICE || \
|
#define NOCONTROLDEV(err) ((err) == LIBUSB_ERROR_NO_DEVICE || \
|
||||||
(err) == LIBUSB_ERROR_OTHER)
|
(err) == LIBUSB_ERROR_OTHER)
|
||||||
|
|
||||||
@ -2779,7 +2782,7 @@ int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_
|
|||||||
err = LIBUSB_ERROR_OTHER;
|
err = LIBUSB_ERROR_OTHER;
|
||||||
}
|
}
|
||||||
out_noerrmsg:
|
out_noerrmsg:
|
||||||
if (NODEV(err)) {
|
if (WRITENODEV(err)) {
|
||||||
cg_ruwlock(&cgpu->usbinfo.devlock);
|
cg_ruwlock(&cgpu->usbinfo.devlock);
|
||||||
release_cgpu(cgpu);
|
release_cgpu(cgpu);
|
||||||
DEVWUNLOCK(cgpu, pstate);
|
DEVWUNLOCK(cgpu, pstate);
|
||||||
|
Loading…
Reference in New Issue
Block a user