Jens Axboe wrote: > On Tue, Nov 21 2006, Pavel Machek wrote: >> Hi! >> [...] >> > After some googeling and digging in gamne i read that someone said that >> > there are plans for some generic support for HD-parking in the kernel >> > and thus making such patches obsolete. [...] >> I'm afraid we need your help with development here. Porting old patch >> to 2.6.19-rc6 should be easy, and then you can start 'how do I >> makethis generic' debate. > > 2.6.19 will finally have the generic block layer commands, so this can > be implemented properly. Eventually, I've ported the patch to 2.6.19-rc6 (attached). However, I'll need some gentle guidance by you developers for the next steps, I'm afraid. What exactly do you mean by "making this generic". Perhaps, you could give me a hint as to which generic block layer commands you have in mind that should be used in such a patch. Here is a short description of what the patch does in its current shape: 1. Adds functions to ide-disk.c and scsi_lib.c that issue an idle immediate with head unload or a standby immediate command as appropriate and stop the queue on command completion. 2. Adds matching queue unfreeze functions that also reenable hd power management (see source code). 3. Adds an option to the ide-disk and libata module respectively which allows to indicate whether idle immediate is supported by the drive. Unfortunately, the implemented auto detection feature often gives false negatives. 4. Adds a sysfs attribute chich can be used to trigger the disk park command and the associated queue freeze. 5. Adds an unfreeze timer that calls the unfreeze function on expiry. Regards, Elias --- block/ll_rw_blk.c | 154 ++++++++++++++++++++++++++++++++++ drivers/ata/libata-core.c | 4 drivers/ata/libata-scsi.c | 38 ++++++++ drivers/ata/libata.h | 1 drivers/ide/ide-disk.c | 155 ++++++++++++++++++++++++++++++++++ drivers/ide/ide-io.c | 14 +++ drivers/scsi/scsi_lib.c | 163 ++++++++++++++++++++++++++++++++++++ include/linux/ata.h | 1 include/linux/blkdev.h | 13 ++ include/linux/ide.h | 1 10 files changed, 544 insertions(+)