adbd: Don't close/reopen FFS ep0 on disconnect
In case of bulk read/write failure or disconnect, transport_usb calls usb_ffs_kick in order to force the daemon to re-open the FunctionFS ep files as a way to soft restart the kernel driver. However, there's no reason to always close the ep0 file, as it would need to be reopened and the descriptors rewritten--this is unnecessary, especially in the simple/frequent case of cable disconnect, and causes the kernel driver to unbind and bind *all* of the function drivers. This is causing USB Chapter 9 tests to fail. Thus, try to reuse the same ep0 file handle across reconnects. In case there is a failure, the ep1/ep2 opens would fail and all the file handles get dropped. For the adb root case, the entire daemon gets restarted anyway. Change-Id: I0840085c52a0795dcb2d751c39aa4a436c039ee2
Loading
Please register or sign in to comment