[haiku-bugs] Re: [Haiku] #15569: usb_disk stalls & unmounts when large I/O transfers are not queued

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Thu, 12 Mar 2020 20:07:25 -0000

#15569: usb_disk stalls & unmounts when large I/O transfers are not queued
--------------------------------+----------------------------
   Reporter:  X512              |      Owner:  nobody
       Type:  bug               |     Status:  new
   Priority:  normal            |  Milestone:  Unscheduled
  Component:  Drivers/Disk/USB  |    Version:  R1/Development
 Resolution:                    |   Keywords:
 Blocked By:                    |   Blocking:
Has a Patch:  0                 |   Platform:  All
--------------------------------+----------------------------
Comment (by pulkomandy):

 Yes, what FreeBSD does makes more sense, I think. The "cam" layer in
 FreeBSD is basically an abstracted storage device system which is more or
 less based on what SCSI provides in terms of commands. Underlying drivers
 implement the actual communication with devices. We have a somewhat
 similar scsi kernel module but currently usb_disk does not use it.

 It is of course not possible (nor desirable) to transparently split the
 transfers at xhci level beyond its maximum size. But, from usb_disk point
 of view, the most efficient thing to do is "as large as possible" (if we
 consider bandwidth as the thing we want to optimize). So, ideally, there
 should be a way to know what's the limit of the underlying usb module, and
 usb_disk would split transfers to that size.

 as for the splitting, the simplest thing to do is probably to cap the
 block count in usb_disk_needs_partial_buffer. The read() call of usb_disk
 will then do a partial read (it adjusts its returned length) and the upper
 layer should then call it again as needed (assuming it handles partial
 reads properly).
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15569#comment:15>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: