From patchwork Thu Oct 11 05:08:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1581001 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 384C640D54 for ; Thu, 11 Oct 2012 05:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753130Ab2JKFIo (ORCPT ); Thu, 11 Oct 2012 01:08:44 -0400 Received: from mga02.intel.com ([134.134.136.20]:3751 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967Ab2JKFIn (ORCPT ); Thu, 11 Oct 2012 01:08:43 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Oct 2012 22:08:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,569,1344236400"; d="scan'208";a="204188158" Received: from mint-spring.sh.intel.com ([10.239.36.118]) by orsmga001.jf.intel.com with ESMTP; 10 Oct 2012 22:08:41 -0700 From: Aaron Lu To: Alan Stern , "Rafael J. Wysocki" , James Bottomley Cc: linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, Aaron Lu , Aaron Lu Subject: [PATCH v2 2/5] Revert "[SCSI] scsi_pm: set device runtime state before parent suspended" Date: Thu, 11 Oct 2012 13:08:08 +0800 Message-Id: <1349932091-6856-3-git-send-email-aaron.lu@intel.com> X-Mailer: git-send-email 1.7.12.21.g871e293 In-Reply-To: <1349932091-6856-1-git-send-email-aaron.lu@intel.com> References: <1349932091-6856-1-git-send-email-aaron.lu@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This reverts commit 33a2285d96b5e7b9500612ec623bf4313397bb53. With commit 88d26136a256576e444db312179e17af6dd0ea87 (PM: Prevent runtime suspend during system resume), this patch is no longer needed. Signed-off-by: Aaron Lu --- drivers/scsi/scsi_pm.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index dc0ad85..d4201de 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c @@ -76,24 +76,23 @@ static int scsi_bus_resume_common(struct device *dev) { int err = 0; - /* - * Parent device may have runtime suspended as soon as - * it is woken up during the system resume. - * - * Resume it on behalf of child. - */ - pm_runtime_get_sync(dev->parent); - - if (scsi_is_sdev_device(dev)) + if (scsi_is_sdev_device(dev)) { + /* + * Parent device may have runtime suspended as soon as + * it is woken up during the system resume. + * + * Resume it on behalf of child. + */ + pm_runtime_get_sync(dev->parent); err = scsi_dev_type_resume(dev); + pm_runtime_put_sync(dev->parent); + } + if (err == 0) { pm_runtime_disable(dev); pm_runtime_set_active(dev); pm_runtime_enable(dev); } - - pm_runtime_put_sync(dev->parent); - return err; }