On Wed, 6 May 2015, yoma sophian wrote: > hi all: > below are call back functions of usb_storage_driver: > static struct usb_driver usb_storage_driver = { > .name = "usb-storage", > .probe = storage_probe, > .disconnect = usb_stor_disconnect, > .suspend = usb_stor_suspend, > .resume = usb_stor_resume, > .reset_resume = usb_stor_reset_resume, > .pre_reset = usb_stor_pre_reset, > .post_reset = usb_stor_post_reset, > .id_table = usb_storage_usb_ids, > .supports_autosuspend = 1, > .soft_unbind = 1, > }; > > my questions are: > 1. where we register the us->suspend_resume_hook in usb_stor_suspend? > I grep the src, but cannot find where the callback is registered. The callback can be registered between the calls to usb_stor_probe1() and usb_stor_probe2(). > 2. suppose we are doing the scsi read/write command and system > suddenly store to RAM/DISK, will that scsi command do? > Drop it or keep the unfinished part ? It will wait until the SCSI command is finished and then invoke your callback routine. > if the later one, will driver redo all CBW, in/out data, CSW? > if the previous one, where we keep the record that this scsi command > is dropeed due to hibernate? > > appreciate your kind help, 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