On Sat, 25 Aug 2012, Sebastian Andrzej Siewior wrote: > On Fri, Aug 24, 2012 at 10:50:54AM -0400, Alan Stern wrote: > > Sebastian, you might be able to check this yourself. What does > > tcm_usb_gadget do when it gets a USB port reset? Does it tell the > > storage layer to sync all the dirty pages? > No, it leavs the storage layer alone. Then your gadget isn't subject to the problem that Peter reported. > > Also, does it sync the dirty pages when it gets a USB disconnect? > > As far as I can see, a sync happens on > - SYNCHRONIZE_CACHE CDB > - on write CDBs with FUA=1 (WCE is ignored here) > > which means it has to be requested by the initiator. For safety's sake, it would be a good idea to flush the dirty pages when a disconnect occurs. > Nothing happens on US_BULK_RESET_REQUEST or on function.disable callback. I don't know about function.disable -- does this mean your function is getting removed from the device's configuration? If it does then the backing storage should be closed. If there's an ongoing I/O operation, US_BULK_RESET_REQUEST should abort it. After processing the class-specific reset, the gadget is supposed to be ready to accept and carry out new commands. Alan Stern -- 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