Skip to content

PM: simplify the code logic on device_shutdown and suspend

Pingfan Liu linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drivers/base: move device_shutdown() to base/powerdrivers/base/core.c drivers/base/power/Makefile drivers/base/power/shutdown.c+77 -702 replies
2/3PM/shutdown: device_shutdown() uses the order info in dpm_list instead of devices_ksetdrivers/base/power/main.c drivers/base/power/power.h drivers/base/power/shutdown.c +1 more+104 -1100 replies
3/3drivers/base: clean up unused devices_kset_move_*() functionsdrivers/base/base.h drivers/base/core.c+0 -570 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] PM: simplify the code logic on device_shutdown and suspend

At present, the "parent <- child" and "suppiler <- consumer" ordering info are stored duplicate in two places dpm_list and devices_kset, and corresponding, there are two sets of routines to manipulate them. The patch pushes the dpm_list and dpm_list_mtx out of CONFIG_PM, and let device_shutdown() use them to implement shutdown seq. Comparing to original code, this patch tries to simplify the code at the cost of a extra mutex if without CONFIG_PM and nothing if with CONFIG_PM. The cost on dpm_list_mtx can be ignored, since the device hot add/remove is not very frequently.

Cc Greg Kroah-Hartman <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>

---
Pingfan Liu (3):
drivers/base: move device_shutdown() to base/power PM/shutdown: device_shutdown() uses the order info in dpm_list instead
of devices_kset
drivers/base: clean up unused devices_kset_move_*() functions

 drivers/base/base.h           |   1 -
 drivers/base/core.c           | 126 ------------------------------------------
 drivers/base/power/Makefile   |   1 +
 drivers/base/power/main.c     | 119 +++++++++++----------------------------
 drivers/base/power/power.h    |  25 ++++++---
 drivers/base/power/shutdown.c | 123 +++++++++++++++++++++++++++++++++++++++++
 include/linux/pm.h            |   7 +--
 7 files changed, 173 insertions(+), 229 deletions(-)
 create mode 100644 drivers/base/power/shutdown.c
Signature · 1 line
2.7.4