Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'pci/pm'

- Avoid redundant delay on transition from D3hot to D3cold if the device
was already in D3hot (Brian Norris)

- Prevent runtime suspend until devices are fully initialized to avoid
saving incompletely configured device state (Brian Norris)

* pci/pm:
PCI/PM: Prevent runtime suspend until devices are fully initialized
PCI/PM: Avoid redundant delays on D3hot->D3cold

+18 -1
+8
drivers/pci/bus.c
··· 15 15 #include <linux/of.h> 16 16 #include <linux/of_platform.h> 17 17 #include <linux/platform_device.h> 18 + #include <linux/pm_runtime.h> 18 19 #include <linux/proc_fs.h> 19 20 #include <linux/slab.h> 20 21 ··· 379 378 } 380 379 put_device(&pdev->dev); 381 380 } 381 + 382 + /* 383 + * Enable runtime PM, which potentially allows the device to 384 + * suspend immediately, only after the PCI state has been 385 + * configured completely. 386 + */ 387 + pm_runtime_enable(&dev->dev); 382 388 383 389 if (!dn || of_device_is_available(dn)) 384 390 pci_dev_allow_binding(dev);
+10 -1
drivers/pci/pci.c
··· 1488 1488 || (state == PCI_D2 && !dev->d2_support)) 1489 1489 return -EIO; 1490 1490 1491 + if (dev->current_state == state) 1492 + return 0; 1493 + 1491 1494 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); 1492 1495 if (PCI_POSSIBLE_ERROR(pmcsr)) { 1493 1496 pci_err(dev, "Unable to change power state from %s to %s, device inaccessible\n", ··· 3199 3196 poweron: 3200 3197 pci_pm_power_up_and_verify_state(dev); 3201 3198 pm_runtime_forbid(&dev->dev); 3199 + 3200 + /* 3201 + * Runtime PM will be enabled for the device when it has been fully 3202 + * configured, but since its parent and suppliers may suspend in 3203 + * the meantime, prevent them from doing so by changing the 3204 + * device's runtime PM status to "active". 3205 + */ 3202 3206 pm_runtime_set_active(&dev->dev); 3203 - pm_runtime_enable(&dev->dev); 3204 3207 } 3205 3208 3206 3209 static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop)