lkml.org 
[lkml]   [2008]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ata: ahci: power off unused ports
Kristen Carlson Accardi wrote:
> power off unused ports
>
> If the port isn't either a drive bay or an external SATA port, do not
> keep the phy powered on if the port is unoccupied. This saves .75 watts
> on most laptops. A module parameter can be used to override this
> behavior and allow the phy's to be powered up regardless of whether it
> has externally accessible SATA ports.
>
> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
..
> +static void ata_phy_offline(struct ata_link *link)
> +{
> + u32 scontrol;
> + int rc;
> +
> + /* set DET to 4 */
> + rc = sata_scr_read(link, SCR_CONTROL, &scontrol);
> + if (rc)
> + return;
> + scontrol &= ~0xf;
> + scontrol |= (1 << 2);
> + sata_scr_write(link, SCR_CONTROL, scontrol);
> +}
..

I don't like to be picky, but we already have an "ata_link_offline"
function in libata, which tests *whether* a link is offline,
as opposed to *setting* a link to be offline.

So in that context, I find the name ata_phy_offline slightly confusing.
Perhaps something like ata_set_phy_offline would make it more clear?

And a more general note: I still believe we should have a follow-up
feature to this one, to enable polling for newly inserted drives.

That would allow powering down idle ports to save money/planet/whatever,
but still with hotplug capability. The polling interval should be
tunable in /sys, with a default of, say, once every couple of seconds.

Thanks for working on this stuff.

Cheers


\
 
 \ /
  Last update: 2008-05-09 17:09    [W:0.225 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site