Commit 9eefcfd
committed
drivers/nutdrv_qx.c, drivers/blazer_usb.c: cypress_command()/phoenix_command(): clear endpoint halt and retry on LIBUSB_ERROR_OVERFLOW [#598]
Some firmware in the 0665:5161 Cypress USB-Serial bridge family
(Salicru SPS ONE, Ippon, Belkin F6C1200-UNV, ViewPower, various
Voltronic Power UPSes) occasionally emits an interrupt-IN frame
larger than the declared wMaxPacketSize=8, mid-reply. The kernel
xHCI driver flags this as LIBUSB_ERROR_OVERFLOW and discards the
data; from that point on, every subsequent read on the endpoint
also returns OVERFLOW until a USB-level reset is performed, which
results in "Data stale" from upsd until the driver is restarted.
Issue an immediate CLEAR_FEATURE(HALT) on EP 0x81 and retry the
read once. CLEAR_FEATURE(HALT) unsticks the kernel-side endpoint
state, and in the observed cases the firmware's TX FIFO state as
well, so the next read returns a clean frame. If the retry also
overflows, the existing error path is taken unchanged.
Captured at byte level on a Salicru SPS 1500 ONE BL (Voltronic-QS
H-protocol over 0665:5161, host xHCI on Linux 6.14): firmware
emits chunks 3..6 of the QS reply collapsed into a single frame
that exceeds wMaxPacketSize, kernel reports LIBUSB_ERROR_OVERFLOW,
and all subsequent reads on EP 0x81 return OVERFLOW until a port
reset.
The same fix is applied to cypress_command() and phoenix_command()
in both drivers because the read loops are byte-identical and the
bug is at the USB transport layer, below either subdriver's
protocol logic.
Signed-off-by: Pedro Cunha <pedroagracio+nut@gmail.com>1 parent 0d2c7a1 commit 9eefcfd
2 files changed
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
131 | 151 | | |
132 | 152 | | |
133 | 153 | | |
| |||
212 | 232 | | |
213 | 233 | | |
214 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
215 | 255 | | |
216 | 256 | | |
217 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
781 | 801 | | |
782 | 802 | | |
783 | 803 | | |
| |||
989 | 1009 | | |
990 | 1010 | | |
991 | 1011 | | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
992 | 1032 | | |
993 | 1033 | | |
994 | 1034 | | |
| |||
0 commit comments