On Tue, Jul 08, 2014 at 01:01:27PM +1000, NeilBrown wrote: > On Mon, 7 Jul 2014 22:42:29 +0800 loody <miloody@xxxxxxxxx> wrote: > > > hi all: > > we met a USB Hard Disk that will go to suspend if host stop > > sending scsi read command over 5mins. > > To save the IO, kernel will keep the file in page cache as much as > > he can and under this circumstances, the read command may disappear > > for a while longer enough to cause the device suspend. > > > > is there any kernel config or module parameter can do the dummy > > read periodically, even the sector 0 (MBR) is fine. > > or is there any kernel api I can use to read sector 0(MBR) maybe > > every 4mins? > > Open the device with O_DIRECT and read a block every 4 minutes. > That should keep it awake. modifying /sys/module/usbcore/parameters/autosuspend might also have the desired effect without the need for periodic reads. Dave -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html