Difference between revisions of "Problem with APS harddisk parking"

From ThinkWiki
Jump to: navigation, search
m (Problem with Hard Drive Firmware)
(Added Seagate ST9500420AS as supported hdd)
 
(26 intermediate revisions by 14 users not shown)
Line 1: Line 1:
When trying to enable APS functionality by installing <tt>hdaps_protect</tt> and <tt>hdapsd</tt>, the following problems might occur.
+
{| width="100%"
 +
|style="vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;" | __TOC__
 +
|style="vertical-align:top" |
 +
When trying to [[How to protect the harddisk through APS|enable APS functionality]] by installing <tt>hdaps_protect</tt> and <tt>hdapsd</tt>, the following problems might occur.
 +
|}
  
 
==Problem with unload capabilities check==
 
==Problem with unload capabilities check==
Line 17: Line 21:
  
 
=== Drives which have this problem ===
 
=== Drives which have this problem ===
* Hitachi HTS726060M9AT00 (7K60) on ThinkPad {{T43}}
+
* [[Hitachi Travelstar 7K60]] HTS726060M9AT00 on ThinkPad {{T43}}
 +
* Fujitsu MHT2040AH (846C) on ThinkPad {{T41}} or {{R51}}
  
 
=== Solution for kernel 2.6.16 or later ===
 
=== Solution for kernel 2.6.16 or later ===
Line 32: Line 37:
 
     ide-disk.protect_method=1
 
     ide-disk.protect_method=1
  
If disk driver is built as module, the following to your modprobe configuration (e.g., {{path|/etc/modprobe.conf}}):
+
If disk driver is built as module, add the following to your modprobe configuration (e.g., {{path|/etc/modprobe.conf}}):
 
     options libata protect_method=1
 
     options libata protect_method=1
 
     options ide-disk protect_method=1
 
     options ide-disk protect_method=1
Line 67: Line 72:
 
</pre>
 
</pre>
  
==Problem with Hard Drive Firmware==
+
==Problem with hard drive firmware==
In case you see a message like below in {{cmdroot|dmesg}} output after you have started the hdaps daemon,  
+
Drivers other than those sold by IBM for APS-equipped ThinkPads may lack the head unload command.
a firmware upgrade of your harddisk might solve your problem.
+
 
 +
===Detection===
 +
If you see the following message in {{cmdroot|dmesg}} output after you have started the hdaps daemon, your drive lacks the unload feature (the converse is not true).
 
   
 
   
 
  ide_protect_queue(): head NOT parked!..  
 
  ide_protect_queue(): head NOT parked!..  
 
  ide_unprotect_queue(): No pending I/O, re-enabling power management..
 
  ide_unprotect_queue(): No pending I/O, re-enabling power management..
 +
 +
You can also directly test for the head unload function by running the following Perl script:
 +
 +
<pre>
 +
#!/usr/bin/perl
 +
# Unload disk head on drives that support IDLE IMMEDIATE with the UNLOAD feature.
 +
$dev="$ARGV[0]" or die "Specify device as argument.\n";
 +
$HDIO_DRIVE_TASK=0x031e;
 +
$args=pack("ccccccc",0xe1,0x44,0,0x4C,0x4E,0x55,0);
 +
open(DEV,"<",$dev) or die "open(\"$dev\"): $!\n";
 +
ioctl(DEV,$HDIO_DRIVE_TASK,$args) or die "Unload failed: $!\n";
 +
</pre>
 +
 +
Due to a limitation of the Linux kernel libata system, it is not possible for this program to check if the unload worked. You'll have to listen for the characteristic sound (a faint click and a change in spinning sound) to learn if the unload worked.
 +
 +
===Solutions===
 +
A firmware upgrade of your harddisk might add the missing function.
  
 
Go to the [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-62282 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).  
 
Go to the [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-62282 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 {{cmdroot| hdparm -I /dev/hda}} to get your harddisk model name and firmware version (replace <tt>/dev/hda</tt> with the actual device for your hard drive).
+
===Supported/unsupported harddrive firmwares===
 +
Use {{cmdroot| hdparm -i /dev/hda}} to get your harddisk model name and firmware version (replace <tt>/dev/hda</tt> with the actual device for your hard drive).
 +
On newer models, you need {{cmdroot| sdparm -i /dev/sda}} (or {{cmdroot| hdparm -I /dev/sda}} ) because of the SATA controller.
 +
 
 +
The following line is the important one in the output:
 +
 
 +
Model=HTS726060M9AT00, FwRev=MH4O'''A6GA''', SerialNo=MRHXXXXXXXXX
 +
 
 +
The last four characters of the '''FwRev''' actually marks the firmware version.
 +
 +
The table lists known working / not working firmware versions with [[HDAPS]]
  
This helped with a Hitachi HTS726060M9AT00 harddisk on a Thinkpad {{R50p}}.
+
{| cellspacing="0" cellpadding="2" border="1"
 +
|- style="text-align:left;"
 +
!Drive!!firmware!!park command output!!Source
 +
|- style="text-align:left;vertical-align:top;"
 +
| IC25N040ATCS04-0 || CA40'''A71A''' || not parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| IC25N040ATMR04-0 || MO2O'''AD4A''' || not parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| IC25N040ATMR04-0 || MO2O'''ADEA''' || not parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTC426040G9AT00 || 00P4'''A0B4''' || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTC426060G9AT00 || 00P3'''A0B4''' || parked (method=1)
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS548040M9AT00 || MG20'''A5BA''' || not parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS548040M9AT00 || MG20'''A5HA''' || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS548040M9AT00 || MG2O'''A5PA''' || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS548080M9AT00 || (TBA) || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS541060G9AT00 || MB3I'''A60A''' || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS726060M9AT00 || MH4O'''A6GA''' || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| HITACHI HTS722016K9SA00 || DCDZC75A || parked, and specs mention  UNLOAD capability
 +
|- style="text-align:left;vertical-align:top;"
 +
| Fujitsu MHT2040AH || 846C || parked, and specs mention  UNLOAD capability
 +
|- style="text-align:left;vertical-align:top;"
 +
| Fujitsu MHT2040AH || 8471 || parked, and specs mention UNLOAD capability
 +
|- style="text-align:left;vertical-align:top;"
 +
| Fujitsu MHV2060AH/MHV2100AH/MHV2120AH ||      || specs mention UNLOAD capability
 +
|- style="text-align:left;vertical-align:top;"
 +
| Fujitsu MHV2120BH PL || 0084'''002A''' || parked || Lenovo
 +
|- style="text-align:left;vertical-align:top;"
 +
| Fujitsu MHY2250BH || 0084'''000D''' || parked (work fine) || Lenovo
 +
|- style="text-align:left;vertical-align:top;"
 +
| Fujitsu MHY2320BH G1 ||  || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| Seagate ST9160821A (160GB PATA) || 5MAA'''TJHL''' || parked (and reports UNLOAD capability)
 +
|- style="text-align:left;vertical-align:top;"
 +
| Seagate ST9500325AS (500GB SATA) || 0001'''SDM1''' || parked (specs mention UNLOAD capability + QuickStep)
 +
|- style="text-aling:left;vertical-align:top;"
 +
| Seagate ST9500420AS (500GB SATA) || 0003'''LVM1''' || parked
 +
|- style="text-align:left;vertical-align:top;"
 +
| Western Digital WD1600BEKT-00F3T0 || 11.'''1A11''' || parked (and hdparm reports UNLOAD capability)
 +
|}

Latest revision as of 09:40, 15 June 2010

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

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, add 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

Drivers other than those sold by IBM for APS-equipped ThinkPads may lack the head unload command.

Detection

If you see the following message in # dmesg output after you have started the hdaps daemon, your drive lacks the unload feature (the converse is not true).

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

You can also directly test for the head unload function by running the following Perl script:

#!/usr/bin/perl
# Unload disk head on drives that support IDLE IMMEDIATE with the UNLOAD feature.
$dev="$ARGV[0]" or die "Specify device as argument.\n";
$HDIO_DRIVE_TASK=0x031e;
$args=pack("ccccccc",0xe1,0x44,0,0x4C,0x4E,0x55,0);
open(DEV,"<",$dev) or die "open(\"$dev\"): $!\n";
ioctl(DEV,$HDIO_DRIVE_TASK,$args) or die "Unload failed: $!\n";

Due to a limitation of the Linux kernel libata system, it is not possible for this program to check if the unload worked. You'll have to listen for the characteristic sound (a faint click and a change in spinning sound) to learn if the unload worked.

Solutions

A firmware upgrade of your harddisk might add the missing function.

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).

Supported/unsupported harddrive firmwares

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). On newer models, you need # sdparm -i /dev/sda (or # hdparm -I /dev/sda ) because of the SATA controller.

The following line is the important one in the output:

Model=HTS726060M9AT00, FwRev=MH4OA6GA, SerialNo=MRHXXXXXXXXX

The last four characters of the FwRev actually marks the firmware version.

The table lists known working / not working firmware versions with HDAPS

Drive firmware park command output Source
IC25N040ATCS04-0 CA40A71A not parked
IC25N040ATMR04-0 MO2OAD4A not parked
IC25N040ATMR04-0 MO2OADEA not parked
HITACHI HTC426040G9AT00 00P4A0B4 parked
HITACHI HTC426060G9AT00 00P3A0B4 parked (method=1)
HITACHI HTS548040M9AT00 MG20A5BA not parked
HITACHI HTS548040M9AT00 MG20A5HA parked
HITACHI HTS548040M9AT00 MG2OA5PA parked
HITACHI HTS548080M9AT00 (TBA) parked
HITACHI HTS541060G9AT00 MB3IA60A parked
HITACHI HTS726060M9AT00 MH4OA6GA parked
HITACHI HTS722016K9SA00 DCDZC75A parked, and specs mention UNLOAD capability
Fujitsu MHT2040AH 846C parked, and specs mention UNLOAD capability
Fujitsu MHT2040AH 8471 parked, and specs mention UNLOAD capability
Fujitsu MHV2060AH/MHV2100AH/MHV2120AH specs mention UNLOAD capability
Fujitsu MHV2120BH PL 0084002A parked Lenovo
Fujitsu MHY2250BH 0084000D parked (work fine) Lenovo
Fujitsu MHY2320BH G1 parked
Seagate ST9160821A (160GB PATA) 5MAATJHL parked (and reports UNLOAD capability)
Seagate ST9500325AS (500GB SATA) 0001SDM1 parked (specs mention UNLOAD capability + QuickStep)
Seagate ST9500420AS (500GB SATA) 0003LVM1 parked
Western Digital WD1600BEKT-00F3T0 11.1A11 parked (and hdparm reports UNLOAD capability)