public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: shuox.liu@intel.com
To: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org, pavel@ucw.cz, rjw@sisk.pl,
	len.brown@intel.com, gregkh@linuxfoundation.org,
	yanmin_zhang@linux.intel.com, ShuoX Liu <shuox.liu@intel.com>,
	Zhang Yanmin <yanmin.zhang@intel.com>
Subject: [PATCH 1/2] PM: use dpm_run_callback in device_prepare
Date: Fri,  7 Jun 2013 16:20:31 +0800	[thread overview]
Message-ID: <1370593232-3602-2-git-send-email-shuox.liu@intel.com> (raw)
In-Reply-To: <1370593232-3602-1-git-send-email-shuox.liu@intel.com>

From: ShuoX Liu <shuox.liu@intel.com>

dpm_run_callback could show more debug info around prepare stage.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Liu ShuoX <shuox.liu@intel.com>
---
 drivers/base/power/main.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 5a9b656..cb89323 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1223,7 +1223,7 @@ int dpm_suspend(pm_message_t state)
  */
 static int device_prepare(struct device *dev, pm_message_t state)
 {
-	int (*callback)(struct device *) = NULL;
+	pm_callback_t callback = NULL;
 	char *info = NULL;
 	int error = 0;
 
@@ -1261,10 +1261,7 @@ static int device_prepare(struct device *dev, pm_message_t state)
 		callback = dev->driver->pm->prepare;
 	}
 
-	if (callback) {
-		error = callback(dev);
-		suspend_report_result(callback, error);
-	}
+	error = dpm_run_callback(callback, dev, state, info);
 
 	device_unlock(dev);
 
@@ -1280,6 +1277,7 @@ static int device_prepare(struct device *dev, pm_message_t state)
 int dpm_prepare(pm_message_t state)
 {
 	int error = 0;
+	ktime_t starttime = ktime_get();
 
 	might_sleep();
 
@@ -1311,6 +1309,7 @@ int dpm_prepare(pm_message_t state)
 		put_device(dev);
 	}
 	mutex_unlock(&dpm_list_mtx);
+	dpm_show_time(starttime, state, "prepare");
 	return error;
 }
 
-- 
1.7.1


  reply	other threads:[~2013-06-07  8:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07  8:20 [PATCH 0/2] Run callback of device_prepare/complete consistently shuox.liu
2013-06-07  8:20 ` shuox.liu [this message]
2013-06-07 17:37   ` [PATCH 1/2] PM: use dpm_run_callback in device_prepare Greg KH
2013-06-08  0:43     ` Yanmin Zhang
2013-06-08  1:15       ` Greg KH
2013-06-08  1:21         ` Yanmin Zhang
2013-06-07  8:20 ` [PATCH 2/2] PM: add dpm_run_callback_void and use it in device_complete shuox.liu
2013-06-07 17:38   ` Greg KH
2013-06-07 10:36 ` [PATCH 0/2] Run callback of device_prepare/complete consistently Rafael J. Wysocki
2013-06-08  0:42   ` Yanmin Zhang
2013-06-08  0:54     ` Rafael J. Wysocki
2013-06-08  1:17       ` Yanmin Zhang
2013-06-08  1:25         ` Rafael J. Wysocki
2013-06-08  1:16     ` Greg KH
2013-06-08  1:30       ` Rafael J. Wysocki
2013-06-08  1:36         ` Yanmin Zhang
2013-06-08  1:52           ` Rafael J. Wysocki
2013-06-08  2:37             ` Yanmin Zhang
2013-06-08 10:54               ` Rafael J. Wysocki
2013-06-09  8:11                 ` ShuoX Liu
2013-06-08  1:30       ` Yanmin Zhang
2013-06-10 11:50   ` Pavel Machek

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=1370593232-3602-2-git-send-email-shuox.liu@intel.com \
    --to=shuox.liu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=yanmin.zhang@intel.com \
    --cc=yanmin_zhang@linux.intel.com \
    /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