From: Aaron Lu <aaron.lwe@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>,
Shane Huang <shane.huang@amd.com>,
David Woodhouse <dwmw2@infradead.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH v2] ahci: implement aggressive SATA device sleep support
Date: Fri, 24 Aug 2012 08:49:19 +0800 [thread overview]
Message-ID: <5036CF8F.6050500@gmail.com> (raw)
In-Reply-To: <503647B3.6050706@pobox.com>
On 08/23/2012 11:09 PM, Jeff Garzik wrote:
> On 08/23/2012 06:31 PM, Shane Huang wrote:
>> This patch enables Aggressive Device Sleep only if both host controller
>> and device support it.
> [...]
>
>> @@ -2323,6 +2324,26 @@ int ata_dev_configure(struct ata_device *dev)
>> }
>> }
>>
>> + if (ata_id_has_devslp(dev->id)) {
>> + err_mask = ata_dev_set_feature(dev,
>> + SETFEATURES_SATA_ENABLE,
>> + SATA_DEVSLP);
>> + if (err_mask)
>> + ata_dev_err(dev,
>> + "failed to enable DEVSLP (err_mask=0x%x)\n",
>> + err_mask);
>> + else {
>> + dev->flags |= ATA_DFLAG_DEVSLP;
>> + err_mask = ata_read_log_page(dev,
>> + ATA_LOG_SATA_SETTINGS,
>> + dev->sata_settings,
>> + 1);
>> + if (err_mask)
>> + ata_dev_warn(dev,
>> + "failed to get Identify Device Data\n");
>> + }
>> + }
>> +
>> dev->cdb_len = 16;
>> }
>>
>
> 1) Contra the patch description (quoted above), you are enabling
> SATA_DEVSLP on the device regardless of power policy or host controller
> support.
>
> I'm not sure about the ata_dev_configure() change. If the power policy
> is not enabling aggressive sleep, we should not send this command to the
> device.
My understanding is that the devslp link power state will only be
entered when the host asserts the devslp signal(an out of band signal),
this may be done autonomously by the host or manually programmed by
software, while this patch cares about the former one.
The prerequisite for this would be the device's devslp feature being
already enabled, but enabling this feature for the device doesn't mean
the device wants to initiate a link power state transition.
So I think we can simply enable this feature while configuring this
device and the enter/exit of devslp is taken care of by ahci_set_lpm,
does this make sense?
Please correct me if I'm wrong, thanks.
-Aaron
next prev parent reply other threads:[~2012-08-24 0:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-23 22:31 [PATCH v2] ahci: implement aggressive SATA device sleep support Shane Huang
2012-08-23 15:09 ` Jeff Garzik
2012-08-24 0:49 ` Aaron Lu [this message]
2012-08-24 10:46 ` Huang, Shane
2012-08-24 15:18 ` Huang, Shane
2012-08-24 15:36 ` Jeff Garzik
2012-08-27 10:36 ` Huang, Shane
2012-08-27 16:08 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5036CF8F.6050500@gmail.com \
--to=aaron.lwe@gmail.com \
--cc=dwmw2@infradead.org \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=shane.huang@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.