On Fri, 1 Dec 2017 00:14:52 +0000, Vincent Pelletier <plr.vincent@xxxxxxxxx> wrote: > I'll play some more with a kernel with this patch > to see if it breaks, and will resubmit if it looks fine. Some update: this patch looks good on DWC3: both unplugging and unbinding the UDC while AOI transfers are queued works fine. What I intended to do is to also test it on DWC2, so I bought a raspberry pi zero W (ie, with embedded wifi chip on SDIO), but the fail is strong with me and I just cannot get a custom kernel build to boot (blocks right after detecting mmc0 & mmc1 and listing MMC partitions), so I could not extend my tests yet. I'll keep trying, but testers with a DWC2 or other UDC are very welcome to give that patch a try. To help with tests, here is my test scenario: On both sides: $ git clone https://github.com/vpelletier/python-functionfs.git $ mkdir venv $ virtualenv venv/ $ cd python-functionfs/ $ ../venv/bin/python setup.py install On gadget only: $ cd .. $ sudo aptitude install libaio1 $ git clone https://github.com/vpelletier/python-libaio.git $ cd python-libaio/ $ ../venv/bin/python setup.py install Create a gadget device. My cheat sheet: https://github.com/vpelletier/python-functionfs/tree/master/functionfs/tests On gadget: $ python -u slowprinter.py | venv/bin/python -u device.py /path/to/ffs_mountpoint On host (re-run after disconnects, scripts come from python-functionfs repository): $ python -u slowprinter.py | venv/bin/python -u host.py Plus udev rules to grant current host user access to the usb device. Each side should print the time from other side every second, plus some tracing blather. Test passes if gadget kernel is happy after multiple unplug/plug cycles and both ends can still communicate after re-plugging and restarting host script. Regards, -- Vincent Pelletier -- 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