Re: AHCI power saving (was Re: Ten hours on X60s)

From: Jeff Garzik
Date: Mon Nov 13 2006 - 10:32:46 EST


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.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/