Skip to contentSkip to conversation

PCI / PM / Runtime: Make runtime PM of PCI devices inactive by default

PATCH Applied Rafael J. Wysocki 2 participants 3 messages Feb 27, 2010 – Mar 1, 2010 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI / PM / Runtime: Make runtime PM of PCI devices inactive by default

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

Make the run-time power management of PCI devices be inactive by default by calling pm_runtime_forbid() for each PCI device during its initialization. This setting may be overriden by the user space with the help of the /sys/devices/.../power/control interface.

That's necessary to avoid breakage on systems where ACPI-based wake-up is known to fail for some devices.

---
 drivers/pci/pci.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/pci/pci.c +2 -0
Index: linux-2.6/drivers/pci/pci.c
===================================================================
@@ -1540,8 +1540,10 @@ void pci_pm_init(struct pci_dev *dev)
 	int pm;
 	u16 pmc;
 
+	pm_runtime_forbid(&dev->dev);
 	device_enable_async_suspend(&dev->dev);
 	dev->wakeup_prepared = false;
+
 	dev->pm_cap = 0;
 
 	/* find PCI PM capability in list */
Applied
#1 lore raw
Quoted 21 lines · On Sat, 27 Feb 2010 21:37:37 +0100 "Rafael J. Wysocki" <[email protected]> wrote:

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

Make the run-time power management of PCI devices be inactive by default by calling pm_runtime_forbid() for each PCI device during its initialization. This setting may be overriden by the user space with the help of the /sys/devices/.../power/control interface.

That's necessary to avoid breakage on systems where ACPI-based wake-up is known to fail for some devices.

---
 drivers/pci/pci.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/drivers/pci/pci.c
===================================================================

drivers/pci/pci.c void pci_pm_init(struct pci_dev *dev) · line 1549

Quoted 10 lines
drivers/pci/pci.c +2 -0
@@ -1540,8 +1540,10 @@ void pci_pm_init(struct pci_dev *dev)
 	int pm;
 	u16 pmc;
 
+	pm_runtime_forbid(&dev->dev);
 	device_enable_async_suspend(&dev->dev);
 	dev->wakeup_prepared = false;
+
 	dev->pm_cap = 0;
 
 	/* find PCI PM capability in list */

Applied to my for-linus branch, thanks.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Applied
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 21 lines · On Sat, 27 Feb 2010 21:37:37 +0100 "Rafael J. Wysocki" <[email protected]> wrote:

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

Make the run-time power management of PCI devices be inactive by default by calling pm_runtime_forbid() for each PCI device during its initialization. This setting may be overriden by the user space with the help of the /sys/devices/.../power/control interface.

That's necessary to avoid breakage on systems where ACPI-based wake-up is known to fail for some devices.

---
 drivers/pci/pci.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/drivers/pci/pci.c
===================================================================

drivers/pci/pci.c void pci_pm_init(struct pci_dev *dev) · line 1549

Quoted 10 lines
drivers/pci/pci.c +2 -0
@@ -1540,8 +1540,10 @@ void pci_pm_init(struct pci_dev *dev)
 	int pm;
 	u16 pmc;
 
+	pm_runtime_forbid(&dev->dev);
 	device_enable_async_suspend(&dev->dev);
 	dev->wakeup_prepared = false;
+
 	dev->pm_cap = 0;
 
 	/* find PCI PM capability in list */

Applied to my for-linus branch, thanks.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center