LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI/PM: Skip link training delay for S3 resume
Date: Wed, 11 Mar 2020 12:28:11 +0200	[thread overview]
Message-ID: <20200311102811.GA2540@lahna.fi.intel.com> (raw)
In-Reply-To: <20200311045249.5200-1-kai.heng.feng@canonical.com>

Hi,

On Wed, Mar 11, 2020 at 12:52:49PM +0800, Kai-Heng Feng wrote:
> Commit ad9001f2f411 ("PCI/PM: Add missing link delays required by the
> PCIe spec") added a 1100ms delay on resume for bridges that don't
> support Link Active Reporting.
> 
> The commit also states that the delay can be skipped for S3, as the
> firmware should already handled the case for us.

Delay can be skipped if the firmware provides _DSM with function 8
implemented according to PCI firmwre spec 3.2 sec 4.6.8.

> So let's skip the link training delay for S3, to save 1100ms resume
> time.
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  drivers/pci/pci-driver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index 0454ca0e4e3f..3050375bad04 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -916,7 +916,8 @@ static int pci_pm_resume_noirq(struct device *dev)
>  	pci_fixup_device(pci_fixup_resume_early, pci_dev);
>  	pcie_pme_root_status_cleanup(pci_dev);
>  
> -	if (!skip_bus_pm && prev_state == PCI_D3cold)
> +	if (!skip_bus_pm && prev_state == PCI_D3cold
> +	    && !pm_resume_via_firmware())

So this would need to check for the _DSM result as well. We do evaluate
it in pci_acpi_optimize_delay() (drivers/pci/pci-acpi.c) and that ends
up lowering ->d3cold_delay so maybe check that here.

>  		pci_bridge_wait_for_secondary_bus(pci_dev);
>  
>  	if (pci_has_legacy_pm_support(pci_dev))
> -- 
> 2.17.1

  reply	other threads:[~2020-03-11 10:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  4:52 Kai-Heng Feng
2020-03-11 10:28 ` Mika Westerberg [this message]
2020-03-12  4:23   ` Kai-Heng Feng
2020-03-12  8:04     ` Mika Westerberg
2020-03-12  9:45       ` Kai-Heng Feng
2020-03-12 10:08         ` Mika Westerberg

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=20200311102811.GA2540@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --subject='Re: [PATCH] PCI/PM: Skip link training delay for S3 resume' \
    /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

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).