ahci power management

Johannes Hofmann johannes.hofmann at gmx.de
Sun Sep 13 06:52:22 PDT 2009


Matthew Dillon <dillon at apollo.backplane.com> wrote:
> 
>    If you set up a SYSCTL_PROC (you can probably find examples
>    in various places in the kernel) then whenever the sysctl is
>    read or written the procedure callback is made.
> 
>    In order to safely modify the feature while AHCI is operational
>    you probably just need to get the AHCI port lock.  There are
>    numerous examples in the ahci code of calls to e.g. 
>    ahci_os_lock_port(ap).  So you'd get the lock, modify the
>    feature, and then release the lock.
> 
>    The patch looks pretty good, but needs one or two more passes
>    before comitting.  There are capability bits for AHCI features
>    and the power management feature must be conditionalized on the
>    capability existing.  I think the one that applies is
>    AHCI_REG_CAP_SALP.  See other AHCI_REG_CAP_* uses in the ahci
>    code for examples.
> 

I have updated the patch at 
http://leaf.dragonflybsd.org/~hofmann/ahci_pwrmgmt.patch
accordingly.
Link power management can now be switched on and off with a sysctl.
On my system it is "hw.ahci0.0.link_pwr_mgmt"
(0 = disabled, 1 = medium, 2 = aggressive).

Thanks for the help on the ML and on irc,
  Johannes





More information about the Submit mailing list