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]

 



On 02/04/2012 05:14 PM, Alan Stern wrote:
On Sat, 4 Feb 2012, Sebastian Andrzej Siewior wrote:

What happens if host sends another setup packet while one of the above
request is pending? Most of the controller drivers are nuking the
endpoint and start processing the new packet. But the composite driver's
processing is not canceled. I guess this can happen with the current
"DELAYED_STATUS" implementation also.

You should not continue processing setup packets after you received a
DELAYED_STATUS return code.

No, that's wrong.  The gadget _must_ process SETUP packets, always.

But if break the HW or don't ACK the setup packet or just disable the
IRQs you never receive a second one packet untill the first SETUP
packet is done. The gadget will process the packet but at a later point
in time. After all you could hold a spinlock with irqs for a long time
and notice the second setup packet before the gadget was done with the
first one.

What should happen is that the response to the first SETUP (the one
that was delayed) should not be sent after another SETUP is received.
If the workqueue routine hasn't started running yet, cancelling it
would be a good idea.

That isn't actually that easy. Canceling means waiting until it is
done. What is wrong processing one setup packet after the other?

Alan Stern

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