From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>, Len Brown <lenb@kernel.org>,
Lukas Wunner <lukas@wunner.de>,
Keith Busch <keith.busch@intel.com>,
Ashok Raj <ashok.raj@intel.com>,
Mario.Limonciello@dell.com,
Anthony Wong <anthony.wong@canonical.com>,
Linus Walleij <linus.walleij@linaro.org>,
Sakari Ailus <sakari.ailus@iki.fi>,
linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 05/10] PCI: portdrv: Resume upon exit from system suspend if left runtime suspended
Date: Thu, 13 Sep 2018 16:35:13 +0200 [thread overview]
Message-ID: <7427571.lO1OYF3hGm@aspire.rjw.lan> (raw)
In-Reply-To: <20180913143322.77953-6-mika.westerberg@linux.intel.com>
On Thursday, September 13, 2018 4:33:17 PM CEST Mika Westerberg wrote:
> Currently we try to keep PCIe ports runtime suspended over system
> suspend if possible. This mostly happens when entering suspend-to-idle
> because there is no need to re-configure wake settings.
>
> This causes problems if the parent port goes into D3cold and it gets
> resumed upon exit from system suspend. This may happen for example if
> the port is part of PCIe switch and the same switch is connected to a
> PCIe endpoint that needs to be resumed. The way exit from D3cold works
> according PCIe 4.0 spec 5.3.1.4.2 is that power is restored and cold
> reset is signaled. After this the device is in D0unitialized state
> keeping PME context if it supports wake from D3cold.
>
> The problem occurs when a PCIe hotplug port is left suspended and the
> parent port goes into D3cold and back to D0, the port keeps its PME
> context but since everything else is reset back to defaults
> (D0unitialized) it is not set to detect hotplug events anymore.
>
> For this reason change the PCIe portdrv power management logic so that
> it is fine to keep the port runtime suspended over system suspend but it
> needs to be resumed upon exit to make sure it gets properly re-initialized.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> drivers/pci/pcie/portdrv_pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
> index eef22dc29140..629d5fe4c9b5 100644
> --- a/drivers/pci/pcie/portdrv_pci.c
> +++ b/drivers/pci/pcie/portdrv_pci.c
> @@ -109,8 +109,8 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
>
> pci_save_state(dev);
>
> - dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_SMART_SUSPEND |
> - DPM_FLAG_LEAVE_SUSPENDED);
> + dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NEVER_SKIP |
> + DPM_FLAG_SMART_SUSPEND);
>
> if (pci_bridge_d3_possible(dev)) {
> /*
>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
next prev parent reply other threads:[~2018-09-13 14:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-13 14:33 [PATCH v2 00/10] PCI: Allow D3cold for PCIe hierarchies Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 02/10] PCI / ACPI: Enable wake automatically for power managed bridges Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 03/10] PCI: pciehp: Disable hotplug interrupt during suspend Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 04/10] PCI: pciehp: Do not handle events if interrupts are masked Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 05/10] PCI: portdrv: Resume upon exit from system suspend if left runtime suspended Mika Westerberg
2018-09-13 14:35 ` Rafael J. Wysocki [this message]
2018-09-13 14:33 ` [PATCH v2 06/10] PCI: portdrv: Add runtime PM hooks for port service drivers Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 07/10] PCI: pciehp: Implement runtime PM callbacks Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 08/10] PCI/PME: " Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 09/10] ACPI / property: Allow multiple property compatible _DSD entries Mika Westerberg
2018-09-13 14:33 ` [PATCH v2 10/10] PCI / ACPI: Whitelist D3 for more PCIe hotplug ports Mika Westerberg
2020-04-07 23:54 ` Bjorn Helgaas
2020-04-08 6:04 ` Mika Westerberg
2020-04-08 20:12 ` Bjorn Helgaas
2020-04-09 6:54 ` Mika Westerberg
2020-04-10 22:30 ` Bjorn Helgaas
2020-04-14 6:27 ` Mika Westerberg
[not found] ` <20180913143322.77953-2-mika.westerberg@linux.intel.com>
2018-09-13 14:33 ` [PATCH v2 01/10] PCI: Do not skip power managed bridges in pci_enable_wake() Rafael J. Wysocki
2018-09-14 8:06 ` Mika Westerberg
2018-09-14 8:06 ` Mika Westerberg
2018-09-14 8:11 ` Rafael J. Wysocki
2018-09-14 8:11 ` Rafael J. Wysocki
2018-09-14 8:16 ` Mika Westerberg
2018-09-14 8:16 ` Mika Westerberg
2018-09-14 8:31 ` [PATCH RESEND " Mika Westerberg
2018-09-14 8:31 ` Mika Westerberg
2018-09-18 21:38 ` Bjorn Helgaas
2018-09-18 21:38 ` Bjorn Helgaas
2018-09-28 17:45 ` [PATCH v2 00/10] PCI: Allow D3cold for PCIe hierarchies Bjorn Helgaas
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=7427571.lO1OYF3hGm@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=Mario.Limonciello@dell.com \
--cc=anthony.wong@canonical.com \
--cc=ashok.raj@intel.com \
--cc=bhelgaas@google.com \
--cc=keith.busch@intel.com \
--cc=lenb@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mika.westerberg@linux.intel.com \
--cc=sakari.ailus@iki.fi \
/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).