[haiku-bugs] [Haiku] #17275: [USB] Stack drivers do not properly handle non-isolated fragmented transfers

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 21 Sep 2021 01:51:27 -0000

#17275: [USB] Stack drivers do not properly handle non-isolated fragmented
transfers
--------------------------+---------------------------
 Reporter:  waddlesplash  |       Owner:  waddlesplash
     Type:  bug           |      Status:  assigned
 Priority:  normal        |   Milestone:  Unscheduled
Component:  Drivers/USB   |     Version:  R1/beta3
 Keywords:                |  Blocked By:
 Blocking:                |    Platform:  All
--------------------------+---------------------------
 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.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/17275>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: