Comment 1 for bug 172287

Revision history for this message
Matthias Dietrich (matthias-dietrich) wrote :

Looking at hdparm's code, we can see that the value of 255 will NOT be sent to the harddrive, but it will send the "disable APM"(0x85) command instead of "set APM to xxx" (0x05).

if (apmmode==255) {
   /* disable Advanced Power Management */
   args[2] = 0x85; /* feature register */
   if (get_apmmode) printf(" disabled\n");
} else {
   /* set Advanced Power Management mode */
   args[2] = 0x05; /* feature register */
   args[1] = apmmode; /* sector count register */
   if (get_apmmode)
      printf(" 0x%02x (%d)\n",apmmode,apmmode);
}

However the ATA spec (ATA/ATAPI-7 Vol.1) says:

"Subcommand code 85h disables Advanced Power Management. Subcommand 85h may not be implemented on all devices that implement SET FEATURES subcommand 05h."

So hdparm is probably too optimistic by sending this command. On harddrives not supporting command 85h, using -B 254 is probably the best one can do.

To clarify things, maybe hdparm should have a dedicated option to send 85h (disable APM) and leave -B for the APM values allowed by the spec.