Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753967Ab2BFHcg (ORCPT ); Mon, 6 Feb 2012 02:32:36 -0500 Received: from mga11.intel.com ([192.55.52.93]:54923 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753091Ab2BFHcd (ORCPT ); Mon, 6 Feb 2012 02:32:33 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="121267493" From: Huang Ying To: Alan Stern Cc: ming.m.lin@intel.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , James Bottomley , Huang Ying Subject: [RFC 1/5] pm, runtime, Add resume notifier Date: Mon, 6 Feb 2012 15:32:24 +0800 Message-Id: <1328513548-19786-2-git-send-email-ying.huang@intel.com> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1328513548-19786-1-git-send-email-ying.huang@intel.com> References: <1328513548-19786-1-git-send-email-ying.huang@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1383 Lines: 43 Asynchronous interface is provided for runtime PM, when the requested action (suspend/resume) is completed, the caller may need to be notified. Signed-off-by: Huang Ying --- drivers/base/power/runtime.c | 1 + include/linux/pm.h | 2 ++ 2 files changed, 3 insertions(+) --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -733,6 +733,7 @@ static int rpm_resume(struct device *dev atomic_inc(&parent->power.child_count); } wake_up_all(&dev->power.wait_queue); + atomic_notifier_call_chain(&dev->power.notifier, RPM_REQ_RESUME, dev); if (!retval) rpm_idle(dev, RPM_ASYNC); --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -27,6 +27,7 @@ #include #include #include +#include /* * Callbacks for platform drivers to implement. @@ -488,6 +489,7 @@ struct dev_pm_info { unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; + struct atomic_notifier_head notifier; atomic_t usage_count; atomic_t child_count; unsigned int disable_depth:3; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/