]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: gadget: fix set_halt() bug with pending transfers
authorFelipe Balbi <balbi@ti.com>
Mon, 10 Nov 2014 14:55:44 +0000 (08:55 -0600)
committerJiri Slaby <jslaby@suse.cz>
Thu, 13 Nov 2014 18:03:03 +0000 (19:03 +0100)
commit4220f3ffc14964c3395c031334d088f6fd545009
treedb4f7cb87958ae6605251496368997c2b1d84204
parentd87f96cce9a81981ca3346ff333ad6e9be073a97
usb: dwc3: gadget: fix set_halt() bug with pending transfers

[ Upstream commit 7a60855972f0d3c014093046cb6f013a1ee5bb19 ]

According to our Gadget Framework API documentation,
->set_halt() *must* return -EAGAIN if we have pending
transfers (on either direction) or FIFO isn't empty (on
TX endpoints).

Fix this bug so that the mass storage gadget can be used
without stall=0 parameter.

This patch should be backported to all kernels since v3.2.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c
drivers/usb/dwc3/gadget.h