Commit 6ea5fce
committed
drivers/nutdrv_qx.c: qx_command(): reset USB device after persistent LIBUSB_ERROR_OVERFLOW [#598]
LIBUSB_ERROR_OVERFLOW has been handled as a benign, retry-on-next-poll
condition (grouped with LIBUSB_ERROR_TIMEOUT and the default case) ever
since the original blazer import. For most devices a one-off oversized
interrupt-IN frame is indeed transient. But some Cypress USB-serial
bridge firmware (VID:PID 0665:5161; Salicru SPS, Ippon, ViewPower and
various Voltronic Power UPSes) wedges the endpoint once it overruns:
every subsequent interrupt read returns OVERFLOW and the driver spins in
the stale-data loop until an external USB-level reset. This is the
chronic hang reported in issue #598.
Distinguish the two cases with a small consecutive-overflow counter: the
first QX_USB_OVERFLOW_RESET_TRIES-1 overflows are retried on the next
poll (so genuine transients cost nothing but a skipped cycle), and a
sustained run escalates to usb_reset() + reconnect, reusing the recovery
path already used for PIPE/ETIME/IO errors. Any clean read resets the
counter.
Captured on a Salicru SPS 1500 ONE BL: an isolated overflow recovers on
the next poll, while a sustained lockup (dozens of consecutive overflows
within seconds) is cleared only by the device reset, matching the
behaviour of an external `usb_resetter --reset-device`.
Signed-off-by: Pedro Cunha <pedroagracio+nut@gmail.com>1 parent 8574a2e commit 6ea5fce
1 file changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3881 | 3881 | | |
3882 | 3882 | | |
3883 | 3883 | | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
3884 | 3892 | | |
3885 | 3893 | | |
3886 | 3894 | | |
3887 | 3895 | | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
3888 | 3901 | | |
3889 | 3902 | | |
3890 | 3903 | | |
| |||
3918 | 3931 | | |
3919 | 3932 | | |
3920 | 3933 | | |
| 3934 | + | |
3921 | 3935 | | |
3922 | 3936 | | |
3923 | 3937 | | |
| |||
3979 | 3993 | | |
3980 | 3994 | | |
3981 | 3995 | | |
| 3996 | + | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + | |
| 4000 | + | |
| 4001 | + | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
3982 | 4015 | | |
3983 | | - | |
3984 | 4016 | | |
3985 | 4017 | | |
3986 | 4018 | | |
| |||
0 commit comments