hi Alan: 2014-07-09 0:00 GMT+08:00 Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>: > On Tue, 8 Jul 2014, loody wrote: > >> You are correct. >> i can see events_poll_msecs when I change my kernel to 3.8.0 >> But the device still disconnect. >> I have some question. >> 1. when I cat /sys/block/sdX/events, I get the answer as media_change. >> is there any events type we can choose, such as read capability or inquiry. > > The only other event type is eject_request. But that applies to CD > drives, not disk drives. > >> > Probably you don't actually need to do a read. Simply opening the >> > device file ought to be sufficient. >> 2. the open device you mean is like open(/dev/sda1)? > > Yes. That will send a SCSI TEST UNIT READY command, the same as disk > events polling. You can use usbmon to verify this. > > However, maybe TEST UNIT READY won't work. Your drive might need to > see a READ or WRITE command. If that's the case then neither > events_poll_msecs nor a simple open() will help. > > Have you tried using hdparm with the -B or -S flag? there is one thing pop in my mind. if events_poll_msecs is used for media_change, shouldn't we wrap is READ10? the difference seems 1. change SCSI command 2. allocate 512 Byte for 1 sector dummy read the periodically trigging flow should be the same. if you think above is possible, where we should start from? appreciate your help -- Regards, -- 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