All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Niklas Cassel <niklas.cassel@wdc.com>
Cc: stable@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH 4.19.y] ata: libata: disallow dev-initiated LPM transitions to unsupported states
Date: Sat, 7 Oct 2023 13:34:49 +0200	[thread overview]
Message-ID: <2023100739-captivity-earmark-0270@gregkh> (raw)
In-Reply-To: <20230928155426.9839-1-niklas.cassel@wdc.com>

On Thu, Sep 28, 2023 at 05:54:26PM +0200, Niklas Cassel wrote:
> In AHCI 1.3.1, the register description for CAP.SSC:
> "When cleared to ‘0’, software must not allow the HBA to initiate
> transitions to the Slumber state via agressive link power management nor
> the PxCMD.ICC field in each port, and the PxSCTL.IPM field in each port
> must be programmed to disallow device initiated Slumber requests."
> 
> In AHCI 1.3.1, the register description for CAP.PSC:
> "When cleared to ‘0’, software must not allow the HBA to initiate
> transitions to the Partial state via agressive link power management nor
> the PxCMD.ICC field in each port, and the PxSCTL.IPM field in each port
> must be programmed to disallow device initiated Partial requests."
> 
> Ensure that we always set the corresponding bits in PxSCTL.IPM, such that
> a device is not allowed to initiate transitions to power states which are
> unsupported by the HBA.
> 
> DevSleep is always initiated by the HBA, however, for completeness, set the
> corresponding bit in PxSCTL.IPM such that agressive link power management
> cannot transition to DevSleep if DevSleep is not supported.
> 
> sata_link_scr_lpm() is used by libahci, ata_piix and libata-pmp.
> However, only libahci has the ability to read the CAP/CAP2 register to see
> if these features are supported. Therefore, in order to not introduce any
> regressions on ata_piix or libata-pmp, create flags that indicate that the
> respective feature is NOT supported. This way, the behavior for ata_piix
> and libata-pmp should remain unchanged.
> 
> This change is based on a patch originally submitted by Runa Guo-oc.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> Fixes: 1152b2617a6e ("libata: implement sata_link_scr_lpm() and make ata_dev_set_feature() global")
> Cc: stable@vger.kernel.org
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> (cherry picked from commit 24e0e61db3cb86a66824531989f1df80e0939f26)
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> ---
>  drivers/ata/ahci.c        |  9 +++++++++
>  drivers/ata/libata-core.c | 19 ++++++++++++++++---
>  include/linux/libata.h    |  4 ++++
>  3 files changed, 29 insertions(+), 3 deletions(-)

Both now queued up, thanks.

greg k-h

      reply	other threads:[~2023-10-07 11:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  9:57 FAILED: patch "[PATCH] ata: libata: disallow dev-initiated LPM transitions to" failed to apply to 4.19-stable tree gregkh
2023-09-20 11:28 ` [PATCH] ata: libata: disallow dev-initiated LPM transitions to unsupported states Niklas Cassel
2023-09-28 15:54 ` [PATCH 4.19.y] " Niklas Cassel
2023-10-07 11:34   ` Greg KH [this message]

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=2023100739-captivity-earmark-0270@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dlemoal@kernel.org \
    --cc=niklas.cassel@wdc.com \
    --cc=stable@vger.kernel.org \
    /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.