Skip to content

RFC PCI PM: Make new suspend-resume callbacks carry out core operations

Rafael J. Wysocki linux-acpi linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10PCI PM: Fix poweroff and restore callbacksdrivers/pci/pci-driver.c+5 -50 replies
1/10PCI PM: Fix poweroff and restore callbacksdrivers/pci/pci-driver.c+5 -52 replies
2/10PCI PM: Add suspend counterpart of pci_reenable_devicedrivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+59 -130 replies
2/10PCI PM: Add suspend counterpart of pci_reenable_devicedrivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+59 -134 replies
3/10PCI PM: Power-manage devices without drivers during suspend-resumedrivers/pci/pci-driver.c+29 -40 replies
3/10PCI PM: Power-manage devices without drivers during suspend-resumedrivers/pci/pci-driver.c+29 -42 replies
4/10PCI PM: Move pci_has_legacy_pm_supportdrivers/pci/pci-driver.c+8 -80 replies
4/10PCI PM: Move pci_has_legacy_pm_supportdrivers/pci/pci-driver.c+8 -82 replies
5/10PCI PM: Avoid touching devices behind bridges in unknown statedrivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+74 -380 replies
5/10PCI PM: Avoid touching devices behind bridges in unknown statedrivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+74 -380 replies
5/10PCI PM: Avoid touching devices behind bridges in unknown state (rev. 2)drivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+74 -380 replies
5/10PCI PM: Avoid touching devices behind bridges in unknown state (rev. 2)drivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+74 -388 replies
6/10PCI PM: Rearrange code in pci-driver.cdrivers/pci/pci-driver.c+65 -390 replies
6/10PCI PM: Rearrange code in pci-driver.cdrivers/pci/pci-driver.c+65 -394 replies
7/10PCI PM: Call pci_fixup_device from legacy routinesdrivers/pci/pci-driver.c+19 -330 replies
7/10PCI PM: Call pci_fixup_device from legacy routinesdrivers/pci/pci-driver.c+19 -332 replies
8/10PCI PM: Register power state of devices during initializationdrivers/pci/pci.c+6 -20 replies
8/10PCI PM: Register power state of devices during initializationdrivers/pci/pci.c+6 -22 replies
9/10PCI PM: Run default PM callbacks for all devices using new frameworkdrivers/pci/pci-driver.c+53 -820 replies
9/10PCI PM: Run default PM callbacks for all devices using new frameworkdrivers/pci/pci-driver.c+53 -822 replies
10/10PCI PM: Put PM callbacks in the order of executiondrivers/pci/pci-driver.c+43 -430 replies
10/10PCI PM: Put PM callbacks in the order of executiondrivers/pci/pci-driver.c+43 -432 replies

Reviews trailers per patch

16 of 22 patches have a Reviewed-by or Acked-by.

PatchPavel Machek
1/10A-b A-b
1/10A-b A-b
2/10A-b A-b
2/10A-b A-b
3/10A-b A-b
3/10A-b A-b
4/10A-b A-b
4/10A-b A-b
5/10
5/10
5/10
5/10
6/10
6/10
7/10A-b A-b
7/10A-b A-b
8/10A-b A-b
8/10A-b A-b
9/10A-b A-b
9/10A-b A-b
10/10A-b A-b
10/10A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC][PATCH 0/10] PCI PM: Make new suspend-resume callbacks carry out core operations
Quoted 26 lines · Rafael J. Wysocki
Quoted 11 lines · Rafael J. Wysocki

Hi Len,

The patch below adds the callbacks that save/restore the standard PCI config registers, change the power state of the device etc. to the new suspend-resume callbacks (which are not yet used by device drivers), so that the drivers don't have to worry about these operations.

The saving and restoring of the standard PCI config registers is done with interrupts off, the other things are done with interrupts enabled.

The patch should apply to the current linux-next tree.

Below is a new version of the patch.

Now, the standard config spaces of devices are restored with interrupts disabled, but only if the bridges the devices are behind are in D0. Otherwise, the operation is attempted again with interrupts enabled (presumably the bridge would be put into D0 before that happens).

Also, pci_disable_device() is not called during resume and pci_reenable_device() is used to enable the devices that were enabled during suspend. This allows us to automatically call pci_set_master() for devices that were bus masters before suspend. Additionally, the pci_reenable_device() may be overriden by the driver, by disabling the device during suspend.

Quoted 7 lines

Finally, bridges are handled a bit differently from the regular devices (they are not put into low power states during suspend and pci_enable_wake() is not called for them.

The patch should apply on top of linux-next with the patch fixing pci_update_current_state() I sent yesterday
(http://marc.info/?l=linux-kernel&m=123039199607159&w=4).

In the meantime I realized that the pcibios_enable_device() called from pci_reenable_device() in the resume code path should be balanced by a "suspend" call of the same kind.

Also, I decided to split the patch into a series of smaller patches with their own changelogs to make it easier to follow the changes. Perhaps this way it will be more clear what I'm after.

The patches should apply to linux-next with the patch from
http://marc.info/?l=linux-kernel&m=123039199607159&w=4 on top.

Comments welcome.

Happy New Year to everyone,
Rafael