Bug #1688

[patch] enable AHCI device initiated power management

Added by Johannes.Hofmann about 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Hi,

this patch
http://leaf.dragonflybsd.org/~hofmann/ahci_dipm.diff
enables device initiated AHCI link power management.

Some disks (e.g. the Intel X25-M SSD) don't support host initiated
power management.
Therefore also enable device initiated power management when
ahci power management is set to "aggressive".
This saves about 0.5W on a Thinkpad with Intel X25-M.

* Move the currently unused function ahci_pm_set_feature() to ahci.c
and make it work for ATA_SATAFT_DEVIPS.

* Use ahci_set_feature() to enable ATA_SATAFT_DEVIPS when AHCI power
management is set to "aggressive".

* Set ap->link_pwr_mgmt early in ahci_port_link_pwr_mgmt() to ensure
it is set when ahci_set_feature() -> ahci_poll() -> ahci_port_intr()
is called.

Inspired-by: Linux

Cheers,
Johannes

History

#1 Updated by Johannes.Hofmann about 4 years ago

Johannes Hofmann <> wrote:
> Hi,
>
> this patch
> http://leaf.dragonflybsd.org/~hofmann/ahci_dipm.diff
> enables device initiated AHCI link power management.
>
> Some disks (e.g. the Intel X25-M SSD) don't support host initiated
> power management.
> Therefore also enable device initiated power management when
> ahci power management is set to "aggressive".
> This saves about 0.5W on a Thinkpad with Intel X25-M.
>
> * Move the currently unused function ahci_pm_set_feature() to ahci.c
> and make it work for ATA_SATAFT_DEVIPS.
>
> * Use ahci_set_feature() to enable ATA_SATAFT_DEVIPS when AHCI power
> management is set to "aggressive".
>
> * Set ap->link_pwr_mgmt early in ahci_port_link_pwr_mgmt() to ensure
> it is set when ahci_set_feature() -> ahci_poll() -> ahci_port_intr()
> is called.
>
> Inspired-by: Linux

I've updated the patch according to feedback from dillon on irc. The
new version
http://leaf.dragonflybsd.org/~hofmann/ahci_dipm_2.diff
checks whether device initiated link power management is supported and
only enables it for directly attached devices. I don't know whether or
how this could work with port multipliers and it's mostly interesting
for laptops anyway.
This patch also includes the new link_pwr_state sysctl, so it's all in
one patch now.

Cheers,
Johannes

#2 Updated by dillon about 4 years ago

:I've updated the patch according to feedback from dillon on irc. The
:new version
:
:http://leaf.dragonflybsd.org/~hofmann/ahci_dipm_2.diff
:...

Committed!

-Matt

Also available in: Atom PDF