I had played around with scsi spinup a couple of months ago but then had to
give away my scsi system, so the patch remained unfinished. Let me dig in the
Trying to trap NOT_READY was fine, but I believe the tricky part was one
should avoid to allocate a new request for the spinup command. The number
of requests in the queue is limited, so an additional request issued from
an incomplete request might deadlock. So you have to piggyback the spinup
on the original command, catch it when it completes, and re-issue the
command. Some of the error handlers do similar stuff, but clobber a few
entries from the original command. I therefore added new backup fields to
Scsi_Cmnd in scsi.h. The other changes were local to scsi_lib.c, IIRC.
> P.S. I'd like to use a user mode daemon to detect disk idle, and issue the
> existing ioctl code to spin the disk down, and rely on the kernel to spin it
> back up as needed.
As already suggested elsewhere in this thread, please have a look at noflushd
(http://noflushd.sourceforge.net). It implements all the user level features
you describe. The scsi code is disabled by default, however, because of the
lack of spinup support in the standard kernel. The lastest scsi spinup patch
shipped with noflushd applies to kernel 2.3.28. If you cook up a patch that
works with recent kernels, please let me know!
-- GNU/Linux Audio Mechanics - http://www.glame.de Cutting Edge Office - http://www.c10a02.de GPG Key ID 89BF7E2B - http://www.keyserver.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to firstname.lastname@example.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/