Re: [PATCH] UAS: fix alignment of scatter/gather segments

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

 



On Mon, 29 Apr 2019, Oliver Neukum wrote:

> On Mo, 2019-04-29 at 12:08 -0400, Alan Stern wrote:
> > On Mon, 29 Apr 2019, Oliver Neukum wrote:
> > 
> > > On Mo, 2019-04-29 at 15:06 +0000, David Laight wrote:
> > 
> > > But the statement the old comment made are no longer correct.
> > 
> > Perhaps David would be satisfied if the comment were changed to say 
> > that _some_ USB controller drivers have this unusual alignment 
> > requirement.
> 
> It would seem to me that every controller that does not do
> scatter/gather has this requirement. In other words, this is
> the true requirement of USB. It does not come from the
> controller. It comes from the protocol's need to not
> send a short package.

Are you sure that xHCI has this requirement?  I haven't checked the
spec.  I know that UHCI, OHCI, and EHCI do need this alignment (and
OHCI and EHCI do in fact have hardware support for scatter-gather).

More precisely, what matters is whether the controller is able to merge
two different DMA segments into a single packet.  UHCI can't.  OHCI and
EHCI can, but only if the first segment ends at a page boundary and the
second begins at a page boundary -- it's easier just to say that the
segments have to be maxpacket-aligned.

> The second, old, comment is about controllers.

Well, if the drivers would use bounce buffers to work around the 
controllers' issues then they wouldn't have this special requirement.  
So it really is a combination of what the hardware can do and what the 
driver can do.

Alan Stern




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

  Powered by Linux