Re: [PATCH 5/7] usb: dwc3: ep0: add handling for unaligned OUT transfers

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

 



Hi,

On Mon, Aug 29, 2011 at 04:15:44PM +0200, Sebastian Andrzej Siewior wrote:
> >>It is a short transfer in OUT direction. Don't these have to finish
> >>anyway?
> >
> >the same way dwc3 has a quirk where it won't complete transfers which
> >aren't aligned on wMaxPacketSize (on OUT direction), there could be
> >another controller with a different quirk.
> 
> quirk? What do you do if the the gadget asks for OUT 5 bytes and you
> receive 6 from the host? You throw the one byte away. Shouldn't you at

that would be the host misbehaving. We're talking here about the gadget
side. The lack of support RX DMA transfers which aren't aligned on
wMaxPacketSize is, indeed, a quirk of this hardware.

> some point inform the gadget about this misbehavior? It is part of one

of course we will, but that's not the problem under discussion, right ?
We have never seen that before.

> USB packet so it can not belong to the "next" transfer.
> The core is forcing you to consider this misbehavior as a possibility
> by always having to use wMaxPacketSize for OUT transfers.

Even if I could start a 5 bytes transfer and host wants to send 6
there's nothing we can do about it, other than flushing the fifo,
ignoring that byte, etc...

> >>>Until we know this won't cause problems for anyone else, I rather keep
> >>>this workaround on dwc3 driver, since this is purely a dwc3 limitation.
> >>
> >>Yes, I'm okay with this workaround beeing dwc3 specific. In the long
> >>term I would prefer not having udc have to work around gadget's bugs.
> >
> >it's not a bug on the gadget at all. The gadget is doing exactly what
> >the specification mandates. The bug, lies in dwc_usb3 IP.
> 
> Yeah, but what is wrong about to queue bMaxPacketSize0 in this case and
> check if the Host is really going to send the length the gadget is
> expecting?

Again, this is a quirk of this particular HW. And if we don't have any
other controller behaving similarly, it's just insane to queue
wMaxPacketSize requests just because this one controller smells funny.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux