Skip to content

PM: Rework suspend-resume ordering to avoid problems with shared interrupts (updated 2x)

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11PM: Introduce functions for suspending and resuming device interruptsinclude/linux/interrupt.h include/linux/irq.h kernel/irq/Makefile +3 more+112 -70 replies
1/11PM: Introduce functions for suspending and resuming device interruptsinclude/linux/interrupt.h include/linux/irq.h kernel/irq/Makefile +3 more+112 -70 replies
2/11PM: Rework handling of interrupts during suspend-resumearch/x86/kernel/apm_32.c drivers/base/power/main.c drivers/base/sys.c +4 more+83 -400 replies
2/11PM: Rework handling of interrupts during suspend-resumearch/x86/kernel/apm_32.c drivers/base/power/main.c drivers/base/sys.c +4 more+83 -400 replies
3/11PM: Change suspend code orderingkernel/power/main.c+22 -160 replies
3/11PM: Change suspend code orderingkernel/power/main.c+22 -160 replies
4/11PM: Change hibernation code orderingkernel/power/disk.c+61 -480 replies
4/11PM: Change hibernation code orderingkernel/power/disk.c+61 -480 replies
5/11kexec: Change kexec jump code orderingkernel/kexec.c+9 -100 replies
5/11kexec: Change kexec jump code orderingkernel/kexec.c+9 -100 replies
6/11PCI PM: Consistently use variable name "error" for pm call return valuesdrivers/pci/pci-driver.c+10 -100 replies
6/11PCI PM: Consistently use variable name "error" for pm call return valuesdrivers/pci/pci-driver.c+10 -100 replies
7/11PCI PM: Use pci_set_power_state during early resumedrivers/pci/pci.c+9 -390 replies
7/11PCI PM: Use pci_set_power_state during early resumedrivers/pci/pci.c+9 -390 replies
8/11PCI PM: Move pci_restore_standard_config to pci-driver.cdrivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+17 -220 replies
8/11PCI PM: Move pci_restore_standard_config to pci-driver.cdrivers/pci/pci-driver.c drivers/pci/pci.c drivers/pci/pci.h+17 -220 replies
9/11PCI PM: Put devices into low power states during late suspend (rev. 2)drivers/pci/pci-driver.c+81 -530 replies
9/11PCI PM: Put devices into low power states during late suspend (rev. 2)drivers/pci/pci-driver.c+81 -530 replies
10/11PCI PM: Make pci_set_power_state() handle devices with no PM supportdrivers/pci/pci.c+12 -60 replies
10/11PCI PM: Make pci_set_power_state() handle devices with no PM supportdrivers/pci/pci.c+12 -60 replies
11/11PCI PM: Restore config spaces of all devices during early resumedrivers/pci/pci-driver.c+9 -70 replies
11/11PCI PM: Restore config spaces of all devices during early resumedrivers/pci/pci-driver.c+9 -70 replies

Reviews trailers per patch

None of the 22 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIngo Molnar
SeriesA-b A-b
1/11
1/11
2/11
2/11
3/11
3/11
4/11
4/11
5/11
5/11
6/11
6/11
7/11
7/11
8/11
8/11
9/11
9/11
10/11
10/11
11/11
11/11

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

Read the v1 thread

Cover letter [PATCH 0/11] PM: Rework suspend-resume ordering to avoid problems with shared interrupts (updated 2x)

Hi,

This is an update of the patch series reworking the handling of interrupts during suspend-resume, addressing some comments from Thomas and Ingo.

The following patches modifiy the way in which we handle disabling interrupts during suspend and enabling them during resume. They also change the ordering of the core suspend and hibernation code to take advantage of the new approach to the interrupts and modify the PCI PM core to avoid a few problems.

Namely, interrupts are currently disabled on the boot CPU as soon as the nonboot CPUs have been disabled, which doesn't allow device drivers' "late" suspend and "early" resume callbacks to sleep. Among other things this means they cannot execute ACPI AML routines, which leads to problems with suspend-resume of PCI devices, as recently discussed.

1/11 introduces helper functions used by the subsequent patches.

2/11 modifies the [suspend|hibernation] and resume code, as well as the other code using the device PM framework, so that device drivers will not receive interrupts during the "late" suspend phase, although interrupts will only be disabled on the CPU right before calling sysdev_suspend() (and analogously during resume).

3/11 - 5/11 modify the suspend, hibernation and kexec jump code, respectively, so that the "late" phase of suspending devices will happen before executing the platform "prepare" callback and disabling nonboot CPUs (and analogously during resume).

6/11 is a patch that's already in the PCI linux-next tree and I included it in the series, because the next patches depend on it.

7/11 makes the PCI PM core use pci_set_power_state() to put devices into D0 during early resume, which allows the platform-specific operations to be carried out at that time, if necessary.

8/11 uses the opportunity to move pci_restore_standard_config() to pci-driver.c, where it belongs IMO.

9/11 makes the PCI PM core code put devices into low power states during the "late" phase of suspend which allows us to avoid a long-standing race related to shared interrupts and to handle devices that require some platform-specific operations to be put into low power states appropriately at the same time. [The second rev of the patch retains the current behavior during the "power-off" phase of hibernation, which is that the devices without drivers or without PM support in the drivers are not power managed by the core.]

10/11 fixes pci_set_power_state() so that it doesn't return error code when attempting to put a PCI device without PM support (either native or through the platform) into D0 (such devices are always in D0).

11/11 makes the PCI PM core save and restore the configuration spaces of devices that have no drivers or no PM support in the drivers during suspend and resume, respectively.

There is a git tree containing these patches, for easier testing, at:

git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6.git

(linux-next branch). At the moment it has a merge conflict with the PCI linux-next tree due to 6/11.

Thanks,
Rafael