RE: [PATCH 1/6] usb/gadget: push USB_REQ_SET_INTERFACE and USB_REQ_SET_CONFIGURATION into process context

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

 



> -----Original Message-----
> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Alan Stern
> Sent: Wednesday, February 08, 2012 7:30 AM
> 
> On Wed, 8 Feb 2012, Sebastian Andrzej Siewior wrote:

< snip >

> > Receiving another SETUP packet while handling the current one isn't
> > possible at least on dwc3: Lets say SET_INTERFACE will be delayed. The
> > controller probably acks it immediately. The only thing the driver does
> > is to setup the next transfer to receive another SETUP packet. Right
> > now we delay this step until gadget is done with his SET_INTERFACE. If
> > we don't, we have another setup packet waiting for us (that one after
> > SET_INTERFACE). I don't have an USB sniffer to say that this is what
> > really happens, but it looks like it from the driver perspective.
> 
> That doesn't sound like quite the right approach.  A USB device is
> always supposed to accept SETUP packets.  What the driver needs to do
> is keep track of them, and not give the response for an earlier SETUP
> to the hardware after a later SETUP arrives.  Cases where the two
> things happen simultaneously must be handled by the hardware.

I can verify that Alan is correct here. If the EP0 OUT endpoint is
enabled, the dwc3 controller will always accept and ACK a SETUP
packet. Up to 3 SETUP packets can be held internally in the hardware,
any more than that will be discarded (but still ACKed). The driver
will receive the next queued SETUP packet the next time it starts a
transfer on that endpoint.

-- 
Paul

--
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