Skip to contentSkip to conversation

usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers

DISCUSSION Vincent Pelletier 1 participant 1 message Sep 25, 2018 USB

lore
Share & tools
lore
#0 lore raw

Hello,

Quoted 10 lines · Vincent Pelletier
Quoted 1 line · Bo

Your patch fix the issue BUG: scheduling while atomic:

Yes, although from my understanding of Felipe's answer, the actual bug is the "scheduling" part (sleeping in dwc3 UDC) rather than the "atomic" part.

So my patch addresses, still if my understanding is correct, the wrong half of the problem, and even introduced the regression you identified. Hence my uncertainty...

I notice that neither He's patch, nor a dwc3 change to prevent it from scheduling inside usb_ep_dequeue are in Linus' master. Please correct me if I missed something.

Just in case my previous emails were not clear:
- I have no objection to He's patch on its own (and I do not know the code nearly enough to provide a meaningful reviewed-by).
- I do not intend to work on making changes to dwc3 gadget to stop it from scheduling in usb_ep_dequeue in the foreseeable future.

So if there is no ongoing work on dwc3 cancel behaviour (Felipe ?), please do resume/carry on with reviewing and integrating He's patch.

It is only *if* dwc3 cancel stops scheduling that I believe my patch should be reverted (here is the hash as of Linus' master):
commit d52e4d0c0c428bf2ba35074a7495cdb28e2efbae
Author: Vincent Pelletier <[email protected]>
Date: Wed Jun 13 11:05:06 2018 +0000

usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers

This bug happens only when the UDC needs to sleep during usb_ep_dequeue, as is the case for (at least) dwc3.
and, in my understanding, a consequence is that He's fix would not be needed anymore - the bug my patch introduced disappearing in the revert.

Regards,