Problem with APS harddisk parking

From ThinkWiki
Revision as of 16:13, 16 April 2006 by Wyrfel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

When trying to enable APS functionality by installing hdaps_protect and hdapsd, the following problems might occur.

Problem with unload capabilities check

You may get the following kernel message when the disk is protected (e.g., via # echo 1 > /sys/block/sda/queue/protect):

ata_scsi_issue_protect_fn(): unload support NOT reported..
scsi_protect_queue(): head park not requested, used standby!..

or

idedisk_issue_protect_fn(): unload support NOT reported..
ide_protect_queue(): head park not requested, used standby!..
ATTENTION!
Using HDAPS in the above state may cause frequent drive spin downs, thereby wearing out your hard disk.

If you see this, and you are sure that your drive actually does support unloading (all original drives sold with HDAPS-equipped ThinkPads do), one of the following solutions might help.

Drives which have this problem

  • Hitachi HTS726060M9AT00 (7K60) on ThinkPad T43

Solution for kernel 2.6.16 or later

The hdaps_protect patch for 2.6.16 now accepts the protect_method module parameter to override the parking capability detection, which accepts the following numeric values:

  • 0: autodetect capability
  • 1: "unload the head even if the drive doesn't report it has this capability"
  • 2: "standby even if unload is supported"

Hence, depending on your machine type, and whether the module is built into the kernel or not, you can use one of the following options:

If disk driver is built into kernel, add the following to your kernel boot parameters (e.g. /boot/grub/menu.lst):

   libata.protect_method=1
   ide-disk.protect_method=1

If disk driver is built as module, the following to your modprobe configuration (e.g., /etc/modprobe.conf):

   options libata protect_method=1
   options ide-disk protect_method=1

In both cases, if you know whether you use ide-disk or libata, you can drop the other line.

Solution for kernel 2.6.15 and older

The following patch overrides automatic protect capability detection.

diff -u linux-2.6.15.hdaps/drivers/ide/ide-disk.c linux-2.6.15.hdaps/drivers/ide/ide-disk.c
--- linux-2.6.15.hdaps/drivers/ide/ide-disk.c	2006-01-18 07:11:54.000000000 +0000
+++ linux-2.6.15.hdaps/drivers/ide/ide-disk.c	2006-01-18 07:11:54.000000000 +0000
@@ -869,7 +869,7 @@
 	else
 		printk(KERN_DEBUG "idedisk_issue_protect_fn(): unload support NOT reported..\n");
 
-	return ide_protect_queue(q, (drive->id->cfsse & (1 << 13)) ? 1: 0);
+	return ide_protect_queue(q, 1);
 }
 
 int idedisk_issue_unprotect_fn(request_queue_t *q)
diff -u linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c
--- linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c	2006-01-18 07:15:31.000000000 +0000
+++ linux-2.6.15.hdaps/drivers/scsi/libata-scsi.c	2006-01-18 07:15:31.000000000 +0000
@@ -661,7 +661,7 @@
 		printk(KERN_DEBUG "ata_scsi_issue_protect_fn(): unload support NOT reported..\n");
 
 	/* call scsi_protect_queue, requesting either unload or standby */
-	return scsi_protect_queue(q, ata_id_has_unload(dev->id) ? 1 : 0);
+	return scsi_protect_queue(q, 1);
 }
 
 static int ata_scsi_issue_unprotect_fn(request_queue_t *q)

Problem with Hard Drive Firmware

In case you see a message like below in # dmesg output after you have started the hdaps daemon, a firmware upgrade of your harddisk might solve your problem.

ide_protect_queue(): head NOT parked!.. 
ide_unprotect_queue(): No pending I/O, re-enabling power management..

Go to the IBM harddrive firmware update utility page and check if a firmware upgrade is available for your harddisk. IBM/Lenovo provides a bootdisk for easy firmware upgrade (~17MB download).

Use # hdparm -I /dev/hda to get your harddisk model name and firmware version (replace /dev/hda with the actual device for your hard drive.

This helped with a Hitachi HTS726060M9AT00 harddisk on a Thinkpad R50p.