Re: AHCI power saving

John Fremlin
2006-11-14T13:33:49Z

Jeff Garzik <jeff@garzik.org> writes:

> Pavel Machek wrote:
>> --- a/drivers/ata/ahci.c
>> +++ b/drivers/ata/ahci.c
>> @@ -148,6 +148,8 @@ enum {
>> PORT_IRQ_PIOS_FIS | PORT_IRQ_D2H_REG_FIS,
>> /* PORT_CMD bits */
>> + PORT_CMD_ALPE = (1 << 27), /* Aggressive Link Power Management Enable */
>> + PORT_CMD_ASP = (1 << 26), /* Aggressive entrance to Slumber or Partial power management states */
>> PORT_CMD_ATAPI = (1 << 24), /* Device is ATAPI */
>> PORT_CMD_LIST_ON = (1 << 15), /* cmd list DMA engine running */
>> PORT_CMD_FIS_ON = (1 << 14), /* FIS DMA engine running */
>> @@ -486,7 +488,7 @@ static void ahci_power_up(void __iomem *
>> }
>> /* wake up link */
>> - writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD);
>> + writel(cmd | PORT_CMD_ICC_ACTIVE | PORT_CMD_ALPE | PORT_CMD_ASP, port_mmio + PORT_CMD);
>
>
> Therein lies a key problem. Turning on all of AHCI's aggressive
> power management features DOES save a lot of power. But at the same
> time, it shortens the life of your hard drive, particularly hard
> drives that are really PATA, but have a PATA<->SATA bridge glued on
> the drive to enable connection to SATA controllers.

Are you sure? I thought that these bits will only affect the SATA
communication between the chipset on the motherboard and the chipset
on the drive and are not related to the drive's spinning at all.

Please note that the patch is incorrect because not all AHCI chipsets
support these PM features. It would probably be best to make it
optional: it might slow down drive access, but does certainly save the
environment a little.