#17275 closed bug (fixed)
[USB] Stack drivers do not properly handle non-isolated fragmented transfers
Reported by: | waddlesplash | Owned by: | waddlesplash |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta4 |
Component: | Drivers/USB | Version: | R1/beta3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
In hrev55441, I implemented support for fragmented transfers in XHCI. However, upon further reflection, there is a critical problem here: if more than just the one fragmented transfer is queued at once, then all but the first part of the fragmented transfer will be inadvertently "interspersed" with parts of other transfers, which will cause data corruption, etc. among other problems.
Looking at EHCI and other stack drivers, it appears they all have this exact same oversight. I guess nothing that uses fragmented transfers queues multiple things at once, or else it already would have run into this issue.
Possibly the right thing to do in this case is just to return an error code. I'm not quite sure what the right one would be. Maybe B_DEV_RESOURCE_CONFLICT
? Or just B_BUSY
? "Too many requests" would be the real error code, but we do not have one for that.
Change History (10)
comment:1 by , 3 years ago
Milestone: | Unscheduled → R1/beta4 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:2 by , 3 years ago
Howdy,
I have been succesfully running Haiku from a USB SSD drive for several months.
After the hrev55455 commit, now my Haiku installation does not boot anymore. Specifically, it stops at the third icon of the boot screen.
comment:3 by , 3 years ago
comment:5 by , 3 years ago
Diver reports this is reproducible in VMware, I guess that makes this relatively easy to debug.
comment:6 by , 3 years ago
Could an endless loop cause the problem? Just looking at the code changes from hrev55455 (I didn't test anything!), it seems that while loops are used to iterate over transfers in EHCI, OHCI and UHCI, but the iterators are never incremented (for the case where there is no conflict).
comment:7 by , 3 years ago
Oops, yes, it appears that there is a copy/paste error there. Indeed that is probably the issue.
comment:8 by , 3 years ago
it's not fixed, i upgraded to hrev55457 and haiku still won't boot
here my post describing the events, I thought it was about the intel video driver, but investigating more I found that it is not so, I have attached a photo showing where freeze.
Fixed in hrev55455.