Skip to contentSkip to conversation

PM / PCI: Do not resume any devices in pci_pm_prepare()

PATCH In review Rafael J. Wysocki 3 participants 5 messages Sep 24, 2017 – Sep 26, 2017 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM / PCI: Do not resume any devices in pci_pm_prepare()

From: Rafael J. Wysocki <[email protected]>

It should not be necessary to resume devices with ignore_children set in pci_pm_prepare(), because they should be resumed explcitly by their children drivers during suspend if need be and they will be resumed by pci_pm_suspend() after that anyway, so avoid doing that.

---
 drivers/pci/pci-driver.c |    7 -------
 1 file changed, 7 deletions(-)
drivers/pci/pci-driver.c +0 -7
Index: linux-pm/drivers/pci/pci-driver.c
===================================================================
@@ -680,13 +680,6 @@ static int pci_pm_prepare(struct device
 {
 	struct device_driver *drv = dev->driver;
 
-	/*
-	 * Devices having power.ignore_children set may still be necessary for
-	 * suspending their children in the next phase of device suspend.
-	 */
-	if (dev->power.ignore_children)
-		pm_runtime_resume(dev);
-
 	if (drv && drv->pm && drv->pm->prepare) {
 		int error = drv->pm->prepare(dev);
 		if (error)
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

It should not be necessary to resume devices with ignore_children set in pci_pm_prepare(), because they should be resumed explcitly by

s/explcitly/explicitly/

Quoted 4 lines

their children drivers during suspend if need be and they will be resumed by pci_pm_suspend() after that anyway, so avoid doing that.

I think your previous patches to this file mostly used a "PCI / PM" subject line prefix (as opposed to the "PM / PCI" here). But maybe the difference means something?

Quoted 23 lines
---
 drivers/pci/pci-driver.c |    7 -------
 1 file changed, 7 deletions(-)

Index: linux-pm/drivers/pci/pci-driver.c
===================================================================

drivers/pci/pci-driver.c +0 -7
@@ -680,13 +680,6 @@ static int pci_pm_prepare(struct device
 {
 	struct device_driver *drv = dev->driver;
 
-	/*
-	 * Devices having power.ignore_children set may still be necessary for
-	 * suspending their children in the next phase of device suspend.
-	 */
-	if (dev->power.ignore_children)
-		pm_runtime_resume(dev);
-
 	if (drv && drv->pm && drv->pm->prepare) {
 		int error = drv->pm->prepare(dev);
 		if (error)
#2 lore raw
Quoted 7 lines · Bjorn Helgaas
Quoted 4 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

It should not be necessary to resume devices with ignore_children set in pci_pm_prepare(), because they should be resumed explcitly by

s/explcitly/explicitly/

Yup.

Quoted 10 lines
Quoted 4 lines

their children drivers during suspend if need be and they will be resumed by pci_pm_suspend() after that anyway, so avoid doing that.

I think your previous patches to this file mostly used a "PCI / PM" subject line prefix (as opposed to the "PM / PCI" here). But maybe the difference means something?

No, it doesn't. I'll change it to match the previous ones. :-)

Thanks,
Rafael

#3 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

It should not be necessary to resume devices with ignore_children set in pci_pm_prepare(), because they should be resumed explcitly by their children drivers during suspend if need be and they will be resumed by pci_pm_suspend() after that anyway, so avoid doing that.

Oh, and I meant to also say that you've merged the PM-related things here in the past, so I assume you'll take this one :)

Quoted 23 lines
---
 drivers/pci/pci-driver.c |    7 -------
 1 file changed, 7 deletions(-)

Index: linux-pm/drivers/pci/pci-driver.c
===================================================================

drivers/pci/pci-driver.c +0 -7
@@ -680,13 +680,6 @@ static int pci_pm_prepare(struct device
 {
 	struct device_driver *drv = dev->driver;
 
-	/*
-	 * Devices having power.ignore_children set may still be necessary for
-	 * suspending their children in the next phase of device suspend.
-	 */
-	if (dev->power.ignore_children)
-		pm_runtime_resume(dev);
-
 	if (drv && drv->pm && drv->pm->prepare) {
 		int error = drv->pm->prepare(dev);
 		if (error)
#4 lore raw
Quoted 8 lines · Bjorn Helgaas
Quoted 7 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

It should not be necessary to resume devices with ignore_children set in pci_pm_prepare(), because they should be resumed explcitly by their children drivers during suspend if need be and they will be resumed by pci_pm_suspend() after that anyway, so avoid doing that.

Quoted 4 lines
Quoted 1 line

Oh, and I meant to also say that you've merged the PM-related things here in the past, so I assume you'll take this one :)

I will. :-)