diff options
author | Felipe Balbi <balbi@ti.com> | 2014-09-18 10:01:55 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-03 10:00:55 -0600 |
commit | a7c12eaf2e5eea0c15242ebb7d1d3b6e7fcb62bb (patch) | |
tree | ff1b347072f71f29f42f717e842cff50dff26127 /drivers/usb/dwc3/ep0.c | |
parent | 57943716ff1b0733ab0d9879e572bad04166660a (diff) |
usb: gadget: composite: conditionally dequeue os_desc and setup requests
In case we unload a gadget driver while any of
os_desc_req or req are still pending, we need
to make sure to dequeue them.
By using our setup_pending and os_desc_pending
flags we achieve that in a way that doesn't
cause any regressions because we won't dequeue
a request which was already completed.
The original idea came from Li Jun's commit
f2267089ea17fa97b796b1b4247e3f8957655df3
(usb: gadget: composite: dequeue cdev->req
before free it in composite_dev_cleanup) which,
unfortunately, caused two regressions (kfree()
being called before usb_ep_dequeue() and calling
usb_ep_dequeue() when the request was already
completed). That commit also didn't take care
of os_desc_req which can fall into the same
situation so we must care for that one too.
Note that in order to make code slightly easier
to read, we introduce composite_ep_queue() which
hides details about how to fiddle with our pending
flags.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
0 files changed, 0 insertions, 0 deletions