Re: usbmon problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Mar 2010, Pete Zaitcev wrote:

> On Tue, 23 Mar 2010 10:11:39 -0400 (EDT)
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> > Host controller hardware can't handle scatter-gather transfers unless
> > the boundary between scatterlist elements occurs either at a packet
> > boundary or at a page boundary -- and in fact, the host controller
> > drivers don't handle the case where a page boundary isn't also a packet
> > boundary.
> > 
> > Because of this restriction, and because high-speed bulk endpoints must
> > have a maxpacket length of 512, usb-storage (currently the only
> > scatter-gather USB driver) requires 512-byte alignment of the data
> > buffers.  Any future driver using the scatter-gather library can be
> > expected to include the same requirement.  Hence it is not possible for
> > 2 bytes to cross a page boundary.
> 
> Hmm, that's an interesting chain of reasoning. I see no fault in it,
> so we just need to make sure we google it out when someone other than
> usb-storage somehow manages to submit a tricky buffer and crashes
> usbmon... I'm saving it locally too.

Messing up usbmon wouldn't be the only symptom -- high-speed transfers
would fail because one or more of the non-terminal packets would be
smaller than the maxpacket size.  Similar problems have already been
observed in wusb, where the bulk maxpacket sizes aren't multiples of
512 (and don't ask me why they aren't; that design decision seems
remarkably foolish).

Adding a comment explaining all this to usb_sg_init() seems like a good
idea (another item to add to my todo list)...

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux