From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)"
<linux-ide@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
hdegoede@redhat.com
Subject: Re: [PATCH v2 2/2] ata: ahci: Protect users from setting policies their drives don't support
Date: Mon, 4 Apr 2022 10:10:49 +0900 [thread overview]
Message-ID: <a6a17a22-0cde-9c46-0cd7-127be2cd2792@opensource.wdc.com> (raw)
In-Reply-To: <20220303034912.3615390-2-mario.limonciello@amd.com>
On 3/3/22 12:49, Mario Limonciello wrote:
> As the default low power policy applies to more chipsets and drives, it's
> important to make sure that drives actually support the policy that a user
> selected in their kernel configuration.
>
> If the drive doesn't support slumber, don't let the default policies
> dependent upon slumber (`min_power` or `min_power_with_partial`) affect the
> disk.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Mario,
Can you resend a rebased version of this, on top of libata for-5.19 branch ?
> ---
> Changes from v1->v2:
> * Move deeper into codepaths
> * Reset to MED_POWER rather than ignore
> drivers/ata/libata-sata.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
> index 071158c0c44c..0dc03888c62b 100644
> --- a/drivers/ata/libata-sata.c
> +++ b/drivers/ata/libata-sata.c
> @@ -13,6 +13,7 @@
> #include <scsi/scsi_device.h>
> #include <linux/libata.h>
>
> +#include "ahci.h"
> #include "libata.h"
> #include "libata-transport.h"
>
> @@ -368,10 +369,20 @@ int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy,
> bool spm_wakeup)
> {
> struct ata_eh_context *ehc = &link->eh_context;
> + struct ata_port *ap = link->ap;
> + struct ahci_host_priv *hpriv;
> bool woken_up = false;
> u32 scontrol;
> int rc;
>
> + hpriv = ap->host->private_data;
> + if (policy >= ATA_LPM_MIN_POWER_WITH_PARTIAL &&
> + !(hpriv->cap & HOST_CAP_SSC)) {
> + dev_warn(ap->host->dev,
> + "This drive doesn't support slumber; restting policy to MED_POWER\n");
Typo here: s/restting/resetting. Also, s/doesn't/does not.
> + policy = ATA_LPM_MED_POWER;
Here, shouldn't we use the default policy defined by
CONFIG_SATA_LPM_POLICY ?
> + }
> +
> rc = sata_scr_read(link, SCR_CONTROL, &scontrol);
> if (rc)
> return rc;
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2022-04-04 1:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 3:49 [PATCH v2 1/2] ata: ahci: Drop low power policy board type Mario Limonciello
2022-03-03 3:49 ` [PATCH v2 2/2] ata: ahci: Protect users from setting policies their drives don't support Mario Limonciello
2022-03-03 9:52 ` Damien Le Moal
2022-04-04 1:10 ` Damien Le Moal [this message]
2022-04-04 19:39 ` Limonciello, Mario
2022-04-04 23:30 ` Damien Le Moal
2022-04-04 23:53 ` Limonciello, Mario
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=a6a17a22-0cde-9c46-0cd7-127be2cd2792@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=hdegoede@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox