From: Alan Stern
> > When testing 3.14-rc1 with a USB 3.0 Lexar flash drive, the drive fails
> > to be mounted.
...
> > That revealed the SCSI request fails because the USB core is rejecting a
> > scatter-gather list with an entry that isn't aligned to the max packet size:
> 
> > Feb 28 09:45:30 xanatos kernel: [  376.449316] usb 2-2: URB sg entry 0 of 
> > 17, size 1536 not a
> multiple of ep1in max packet 1024
> 
> Notice the request length: 1536.  That's three 512-byte sectors.  A
> little unusual, since most I/O is done in units of pages, which are
> 4096 bytes.
...
> Some of this behavior is to be expected.  1536 isn't a multiple of 1024
> (the maxpacket size when running at SuperSpeed), but it _is_ a multiple
> of 512 (the maxpacket size when running at high speed).  Therefore the
> failure won't occur when the drive is attached to an EHCI controller or
> is behind a USB-2 hub.

It should be possible to modify the driver so that it is only necessary
to have a 1024 byte boundary within a ring segment.
The last fragment that crosses a 1k boundary would need to be truncated
and then followed by a link TRB.
The only real difficulty is that you then don't know how many TRBs will
be needed until you actually start writing them.
Which might mean moving the ring expansion down into the code that actually
writes the TRBs.
I also think it might be worth queueing some requests as URBs rather than
expanding the rings so that they fit.

However to do that you probably need to apply some of the 'simplifiaction'
patches I wrote first (or equivalent patches).

        David



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

Reply via email to