Skip to content

ACPI / PM: Switch ACPI bus type and drivers to dev_pm_ops

Rafael J. Wysocki linux-acpi lkml platform-driver-x86 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest21 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21ACPI / PM: Drop pm_message_t argument from device suspend callbackdrivers/acpi/fan.c drivers/acpi/processor_idle.c drivers/acpi/scan.c +5 more+9 -110 replies
2/21ACPI / PM: Make acpi_bus_type use struct dev_pm_ops for PM handlingdrivers/acpi/scan.c+4 -30 replies
2/21fujitsu-tablet: Use struct dev_pm_ops for power managementdrivers/platform/x86/fujitsu-tablet.c+5 -30 replies
3/21ACPI / PM: Make acpi_bus_type use driver struct dev_pm_ops callbacksdrivers/acpi/scan.c+47 -130 replies
4/21ACPI: Use struct dev_pm_ops for power management in the fan driverdrivers/acpi/fan.c+11 -100 replies
5/21ACPI: Use struct dev_pm_ops for power management in the thermal driverdrivers/acpi/thermal.c+10 -70 replies
6/21ACPI: Use struct dev_pm_ops for power management in processor driverdrivers/acpi/processor_driver.c drivers/acpi/processor_idle.c include/acpi/processor.h+8 -60 replies
7/21ACPI: Use struct dev_pm_ops for power management in the AC driverdrivers/acpi/ac.c+12 -50 replies
8/21ACPI: Use struct dev_pm_ops for power management in the battery driverdrivers/acpi/battery.c+11 -40 replies
9/21ACPI: Use struct dev_pm_ops for power management in the button driverdrivers/acpi/button.c+6 -30 replies
10/21ACPI: Use struct dev_pm_ops for power management in the power driverdrivers/acpi/power.c+8 -40 replies
11/21ACPI: Use struct dev_pm_ops for power management in the SBS driverdrivers/acpi/sbs.c+6 -40 replies
12/21toshiba_acpi: Use struct dev_pm_ops for power managementdrivers/platform/x86/toshiba_acpi.c+8 -60 replies
13/21hp_accel: Use struct dev_pm_ops for power managementdrivers/platform/x86/hp_accel.c+8 -72 replies
14/21sony-laptop: Use struct dev_pm_ops for power managementdrivers/platform/x86/sony-laptop.c+12 -80 replies
15/21panasonic-laptop: Use struct dev_pm_ops for power managementdrivers/platform/x86/panasonic-laptop.c+11 -50 replies
16/21toshiba_bluetooth: Use struct dev_pm_ops for power managementdrivers/platform/x86/toshiba_bluetooth.c+6 -42 replies
17/21xo15-ebook: Use struct dev_pm_ops for power managementdrivers/platform/x86/xo15-ebook.c+5 -30 replies
18/21acpi_power_meter: Use struct dev_pm_ops for power managementdrivers/hwmon/acpi_power_meter.c+9 -40 replies
19/21ACPI / PM: Do not execute legacy driver PM callbacksdrivers/acpi/scan.c+9 -150 replies
20/21ACPI / PM: Drop legacy driver PM callbacks that are not used any moreinclude/acpi/acpi_bus.h+0 -40 replies
21/21ACPI / PM: Drop PM callbacks from the ACPI bus typedrivers/acpi/scan.c+0 -510 replies

Reviews trailers per patch

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

PatchVikram DhillonÉric PielThadeu Lima de Souza CascardoLen Brown
SeriesA-b A-b
1/21
2/21
2/21
3/21
4/21
5/21
6/21
7/21
8/21
9/21
10/21
11/21
12/21
13/21R-b
14/21
15/21
16/21R-b
17/21
18/21
19/21
20/21
21/21

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/21] ACPI / PM: Switch ACPI bus type and drivers to dev_pm_ops

Hi all,

The following patchset converts the ACPI bus type and all of the ACPI drivers to the power management handling based on struct dev_pm_ops. It does that in the following way:

(1) The (unused) pm_message_t argument is dropped from the ACPI driver suspend callback throughout the tree (patch [1/21]).

(2) A struct dev_pm_ops object is defined for the ACPI bus type (patches [2-3/21]) in such a way that
(a) driver callbacks from struct acpi_device_ops are executed for drivers that provide them,
(b) driver callbacks from struct dev_pm_ops are executed for drivers that provide them,
(c) 0 is returned for the remaining drivers.
Only suspend/resume, freeze/thaw, poweroff/restore bus type callbacks are defined, because they are sufficient for the transition (they are removed later on anyway).

(3) All ACPI drivers that use PM callbacks are converted to the PM handling

    based on struct dev_pm_ops (patches [4-18/21]).

(4) The ACPI bus type is modified not to execute driver callbacks from struct acpi_device_ops any more (patch [19/21]). This affects several x86 platform drivers and the ACPI power meter driver too.

(5) The driver PM callbacks in struct acpi_device_ops are removed

    (patch [20/21]).

(6) The ACPI bus type PM callbacks added in step (2) are dropped, because they aren't necessary any more (the PM core will execute the driver callbacks directly now).

As a result, the redundant bus type level of PM handling between ACPI drivers and the PM core is eliminated and the ACPI drivers are now able to define runtime PM callbacks, proper hibernation callbacks and late/early callbacks for system suspend/resume.

The patchset has been tested on Toshiba Portege R500 and more testing is in the works. If there are no objections, I'd like to push if for 3.6 through the linux-pm tree.

If you want to give it a go, it's available from the pm-acpi branch of the linux-pm tree. Please note, however, that this branch will be rebased, because it is based on the linux-pm tree's linux-next branch at the moment.

Thanks,
Rafael