linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pingfan Liu <kernelfans@gmail.com>
To: linux-pm@vger.kernel.org
Cc: Pingfan Liu <kernelfans@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] PM: simplify the code logic on device_shutdown and suspend
Date: Mon, 20 Aug 2018 17:18:34 +0800	[thread overview]
Message-ID: <1534756717-25553-1-git-send-email-kernelfans@gmail.com> (raw)

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 <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org> 
Cc: linux-kernel@vger.kernel.org
---
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

-- 
2.7.4

             reply	other threads:[~2018-08-20  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20  9:18 Pingfan Liu [this message]
2018-08-20  9:18 ` [PATCH 1/3] drivers/base: move device_shutdown() to base/power Pingfan Liu
2018-09-14  9:07   ` Rafael J. Wysocki
2018-09-19  3:56     ` Pingfan Liu
2018-08-20  9:18 ` [PATCH 2/3] PM/shutdown: device_shutdown() uses the order info in dpm_list instead of devices_kset Pingfan Liu
2018-08-20  9:18 ` [PATCH 3/3] drivers/base: clean up unused devices_kset_move_*() functions Pingfan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1534756717-25553-1-git-send-email-kernelfans@gmail.com \
    --to=kernelfans@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).