Commit ba94551
Loic Poulain
firehose/usb: Explicitly handle ZLP on USB read transfers
The assumption that every other Firehose read transfer is null is
incorrect. A Zero-Length Packet (ZLP) is only sent when the received
transfer size is a multiple of the USB IN endpoint's Max Packet Size.
This is a way for the device to indicated end-of-transfer.
Unconditionally expecting an empty packet was not an issue with USB 2.0,
where the typical 512-byte sector size matches the bulk IN endpoint's
Max Packet Size. However, with USB SuperSpeed (Max Packet Size = 1024),
attempting to read an empty packet after a 512/1024-byte transfer is
unnecessary and fails (timeout), resulting in errors during storage
device sector size discovery:
```
waiting for programmer...
qdl: failed to read: Resource temporarily unavailable
```
Fix and move ZLP handling to bus-specific code (usb.c).
Reported-by: Danilo Leo <[email protected]>
Signed-off-by: Loic Poulain <[email protected]>1 parent a88edc5 commit ba94551
2 files changed
+10
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
646 | 645 | | |
647 | 646 | | |
648 | 647 | | |
| |||
681 | 680 | | |
682 | 681 | | |
683 | 682 | | |
684 | | - | |
685 | | - | |
| 683 | + | |
686 | 684 | | |
687 | 685 | | |
688 | 686 | | |
689 | 687 | | |
690 | 688 | | |
691 | 689 | | |
692 | 690 | | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
| 691 | + | |
700 | 692 | | |
701 | 693 | | |
702 | 694 | | |
| |||
715 | 707 | | |
716 | 708 | | |
717 | 709 | | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | 710 | | |
723 | 711 | | |
724 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
247 | 255 | | |
248 | 256 | | |
249 | 257 | | |
| |||
0 commit comments