linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>, linux-ide@vger.kernel.org
Subject: Re: [PATCH 04/10] ata: libata-eh: Avoid unnecessary resets when revalidating devices
Date: Tue, 1 Jul 2025 11:24:18 +0200	[thread overview]
Message-ID: <aGOpQtkxF1FehZ9G@ryzen> (raw)
In-Reply-To: <097726fe-638a-4336-8427-3eb3055de5b7@kernel.org>

On Tue, Jul 01, 2025 at 03:48:15PM +0900, Damien Le Moal wrote:
> 
> There is a 10ms wait already in sata_link_scr_lpm() but it seems to not always
> be enough. The specs say that transitions out of HIPM "shall not take more than
> 10ms", but hey, we all know how devices always follow the specs, right ? :)

HIPM / ALPM includes Partial, Slumber and DevSleep.

10 ms is for Slumber.

DevSleep can be much longer than that:
          - DevSleep: The Phy logic may be powered down. The exit latency from
                      this state is no longer than 20 ms, unless otherwise
                      specified by DETO in the device Identify Device Data log.


From PxDEVSLP.DETO:
  Device Sleep Exit Timeout (DETO): This field specifies the maximum duration (in
  approximate 1ms granularity) from DEVSLP de-assertion until the device is ready to
  accept OOB. The nominal value is 20ms while the max value is 255ms depending
  on device identification information.


So technically it can be 255 ms :)


Note that we do actually read and save DETO:
https://github.com/torvalds/linux/blob/v6.16-rc4/drivers/ata/libahci.c#L2293-L2295

But like you said below, with this patch, we should be able to remove the sleep
if we wanted, so I don't think that we necessarily need to increase it.


> 
> > From a cursory glance we just continue, and (apparently) hope that
> > everything will be well eventually.
> > Hmm?
> 
> It is fine to continue because transitions out of DIPM/HIPM/DevSleep are
> automatic if you send a command. So we actually do not need to wait at all and
> probably can remove that 10ms sleep in sata_link_scr_lpm(). But I have not for now.

  parent reply	other threads:[~2025-07-01  9:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30  6:26 [PATCH 00/10] Improve link power management Damien Le Moal
2025-06-30  6:26 ` [PATCH 01/10] ata: libata-core: Introduce ata_dev_config_lpm() Damien Le Moal
2025-06-30 14:46   ` Niklas Cassel
2025-07-01  6:09   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 02/10] ata: libata-core: Move device LPM quirk settings to ata_dev_config_lpm() Damien Le Moal
2025-06-30 14:47   ` Niklas Cassel
2025-07-01  6:13   ` Hannes Reinecke
2025-07-01  6:43     ` Damien Le Moal
2025-07-01  7:19       ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 03/10] ata: libata-core: Advertize device support for DIPM and HIPM features Damien Le Moal
2025-06-30 14:47   ` Niklas Cassel
2025-07-01  6:14   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 04/10] ata: libata-eh: Avoid unnecessary resets when revalidating devices Damien Le Moal
2025-06-30 14:47   ` Niklas Cassel
2025-07-01  6:23   ` Hannes Reinecke
2025-07-01  6:48     ` Damien Le Moal
2025-07-01  7:21       ` Hannes Reinecke
2025-07-01  9:24       ` Niklas Cassel [this message]
2025-07-01  9:25         ` Damien Le Moal
2025-06-30  6:26 ` [PATCH 05/10] ata: libata-sata: Disallow changing LPM state if not supported Damien Le Moal
2025-06-30 14:49   ` Niklas Cassel
2025-07-01  6:23   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 06/10] ata: ahci: Disable DIPM if host lacks support Damien Le Moal
2025-06-30 14:50   ` Niklas Cassel
2025-07-01  6:23   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 07/10] ata: ahci: Disallow LPM policy control for external ports Damien Le Moal
2025-06-30 14:50   ` Niklas Cassel
2025-07-01  6:24   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 08/10] ata: ahci: Disallow LPM policy control if not supported Damien Le Moal
2025-06-30  8:30   ` Sergey Shtylyov
2025-06-30 15:07   ` Niklas Cassel
2025-07-01  6:25   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 09/10] ata: libata-core: Reduce the number of messages signaling broken LPM Damien Le Moal
2025-06-30 15:08   ` Niklas Cassel
2025-07-01  6:26   ` Hannes Reinecke
2025-06-30  6:26 ` [PATCH 10/10] ata: libata_eh: Add debug messages to ata_eh_link_set_lpm() Damien Le Moal
2025-06-30 15:11   ` Niklas Cassel
2025-06-30 15:25     ` Sergey Shtylyov
2025-07-01  6:27   ` Hannes Reinecke

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=aGOpQtkxF1FehZ9G@ryzen \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=linux-ide@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).