From patchwork Wed Jul 15 07:38:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 35650 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6F7f2pX022923 for ; Wed, 15 Jul 2009 07:41:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbZGOHh7 (ORCPT ); Wed, 15 Jul 2009 03:37:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753127AbZGOHh6 (ORCPT ); Wed, 15 Jul 2009 03:37:58 -0400 Received: from mga09.intel.com ([134.134.136.24]:46564 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971AbZGOHh5 (ORCPT ); Wed, 15 Jul 2009 03:37:57 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 15 Jul 2009 00:25:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,403,1243839600"; d="scan'208";a="430347232" Received: from rzhang-dt.sh.intel.com (HELO [10.239.36.94]) ([10.239.36.94]) by orsmga002.jf.intel.com with ESMTP; 15 Jul 2009 00:44:50 -0700 Subject: [PATCH 5/8] introduce device async resume From: Zhang Rui To: Linux Kernel Mailing List , linux-pm , linux-acpi Cc: Len Brown , Pavel Machek , "Rafael J. Wysocki" , "Van De Ven, Arjan" , "Zhang, Rui" Date: Wed, 15 Jul 2009 15:38:39 +0800 Message-Id: <1247643519.26272.80.camel@rzhang-dt> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org introduce device async resume. If boot option "dev_async_action" is added, devices can be resumed asynhronously. Signed-off-by: Zhang Rui --- drivers/base/power/main.c | 4 +++- include/linux/async_dev.h | 4 +++- drivers/base/async_dev.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/base/power/main.c =================================================================== --- linux-2.6.orig/drivers/base/power/main.c +++ linux-2.6/drivers/base/power/main.c @@ -445,7 +445,8 @@ static void dpm_resume(pm_message_t stat dev->power.status = DPM_RESUMING; mutex_unlock(&dpm_list_mtx); - error = device_resume(dev, state); + error = dev_async_schedule(dev, device_resume, &state, + DEV_ASYNC_RESUME); mutex_lock(&dpm_list_mtx); if (error) @@ -460,6 +461,7 @@ static void dpm_resume(pm_message_t stat } list_splice(&list, &dpm_list); mutex_unlock(&dpm_list_mtx); + dev_async_synchronization(); } /** Index: linux-2.6/include/linux/async_dev.h =================================================================== --- linux-2.6.orig/include/linux/async_dev.h +++ linux-2.6/include/linux/async_dev.h @@ -29,7 +29,9 @@ struct dev_async_struct { }; #define DEV_ASYNC_SUSPEND 1 -#define DEV_ASYNC_ACTIONS_ALL DEV_ASYNC_SUSPEND +#define DEV_ASYNC_RESUME 2 +#define DEV_ASYNC_ACTIONS_ALL (DEV_ASYNC_SUSPEND | \ + DEV_ASYNC_RESUME) extern int dev_async_schedule(struct device *, void *, void *, int); Index: linux-2.6/drivers/base/async_dev.c =================================================================== --- linux-2.6.orig/drivers/base/async_dev.c +++ linux-2.6/drivers/base/async_dev.c @@ -36,6 +36,7 @@ static int dev_action(struct device *dev switch (type) { case DEV_ASYNC_SUSPEND: + case DEV_ASYNC_RESUME: error = ((dev_async_suspend)func)(dev, *((pm_message_t *)data)); break; default: