[SRU] [OEM-OSP1-B] [PATCH 0/1] Fix resume freeze on S2I

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [OEM-OSP1-B] [PATCH 0/1] Fix resume freeze on S2I

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1854971

[Impact]
Some Laptops use suspend-to-idle freeze at resume.

[Fix]
Delay after PCI power transition completion on suspend-to-idle, just
like runtime resume.

[Test]
With the patch applied, the system can pass suspend stress test.

[Regression Potential]
Low. It's a stable patch that's already in Eoan/Focal kernel.

Rafael J. Wysocki (1):
  PCI: PM: Fix pci_power_up()

 drivers/pci/pci.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[OEM-OSP1-B] [PATCH 1/1] PCI: PM: Fix pci_power_up()

Kai-Heng Feng
From: "Rafael J. Wysocki" <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1854971

There is an arbitrary difference between the system resume and
runtime resume code paths for PCI devices regarding the delay to
apply when switching the devices from D3cold to D0.

Namely, pci_restore_standard_config() used in the runtime resume
code path calls pci_set_power_state() which in turn invokes
__pci_start_power_transition() to power up the device through the
platform firmware and that function applies the transition delay
(as per PCI Express Base Specification Revision 2.0, Section 6.6.1).
However, pci_pm_default_resume_early() used in the system resume
code path calls pci_power_up() which doesn't apply the delay at
all and that causes issues to occur during resume from
suspend-to-idle on some systems where the delay is required.

Since there is no reason for that difference to exist, modify
pci_power_up() to follow pci_set_power_state() more closely and
invoke __pci_start_power_transition() from there to call the
platform firmware to power up the device (in case that's necessary).

Fixes: db288c9c5f9d ("PCI / PM: restore the original behavior of pci_set_power_state()")
Reported-by: Daniel Drake <[hidden email]>
Tested-by: Daniel Drake <[hidden email]>
Link: https://lore.kernel.org/linux-pm/CAD8Lp44TYxrMgPLkHCqF9hv6smEurMXvmmvmtyFhZ6Q4SE+dig@.../T/#m21be74af263c6a34f36e0fc5c77c5449d9406925
Signed-off-by: Rafael J. Wysocki <[hidden email]>
Acked-by: Bjorn Helgaas <[hidden email]>
Cc: 3.10+ <[hidden email]> # 3.10+
(backported from commit 45144d42f299455911cc29366656c7324a3a7c97)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/pci/pci.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4e920d5c6410..b0e559347b33 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -932,19 +932,6 @@ void pci_update_current_state(struct pci_dev *dev, pci_power_t state)
  }
 }
 
-/**
- * pci_power_up - Put the given device into D0 forcibly
- * @dev: PCI device to power up
- */
-void pci_power_up(struct pci_dev *dev)
-{
- if (platform_pci_power_manageable(dev))
- platform_pci_set_power_state(dev, PCI_D0);
-
- pci_raw_set_power_state(dev, PCI_D0);
- pci_update_current_state(dev, PCI_D0);
-}
-
 /**
  * pci_platform_power_transition - Use platform to change device power state
  * @dev: PCI device to handle.
@@ -1123,6 +1110,17 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 }
 EXPORT_SYMBOL(pci_set_power_state);
 
+/**
+ * pci_power_up - Put the given device into D0 forcibly
+ * @dev: PCI device to power up
+ */
+void pci_power_up(struct pci_dev *dev)
+{
+ __pci_start_power_transition(dev, PCI_D0);
+ pci_raw_set_power_state(dev, PCI_D0);
+ pci_update_current_state(dev, PCI_D0);
+}
+
 /**
  * pci_choose_state - Choose the power state of a PCI device
  * @dev: PCI device to be suspended
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [SRU] [OEM-OSP1-B] [PATCH 0/1] Fix resume freeze on S2I

Sultan Alsawaf
In reply to this post by Kai-Heng Feng
On Wed, Dec 04, 2019 at 12:54:25AM +0800, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1854971
>
> [Impact]
> Some Laptops use suspend-to-idle freeze at resume.
>
> [Fix]
> Delay after PCI power transition completion on suspend-to-idle, just
> like runtime resume.
>
> [Test]
> With the patch applied, the system can pass suspend stress test.
>
> [Regression Potential]
> Low. It's a stable patch that's already in Eoan/Focal kernel.
>
> Rafael J. Wysocki (1):
>   PCI: PM: Fix pci_power_up()
>
>  drivers/pci/pci.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Acked-by: Sultan Alsawaf <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

NAK Re: [SRU] [OEM-OSP1-B] [PATCH 0/1] Fix resume freeze on S2I

Timo Aaltonen-6
In reply to this post by Kai-Heng Feng
On 3.12.2019 18.54, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1854971
>
> [Impact]
> Some Laptops use suspend-to-idle freeze at resume.
>
> [Fix]
> Delay after PCI power transition completion on suspend-to-idle, just
> like runtime resume.
>
> [Test]
> With the patch applied, the system can pass suspend stress test.
>
> [Regression Potential]
> Low. It's a stable patch that's already in Eoan/Focal kernel.
>
> Rafael J. Wysocki (1):
>   PCI: PM: Fix pci_power_up()
>
>  drivers/pci/pci.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
>

This is already applied via disco stable updates, so will be included in
-1032.


--
t

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team