From patchwork Fri Nov 9 07:27:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1719101 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 97A44DF264 for ; Fri, 9 Nov 2012 07:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752504Ab2KIH2T (ORCPT ); Fri, 9 Nov 2012 02:28:19 -0500 Received: from mga11.intel.com ([192.55.52.93]:34949 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102Ab2KIH2T (ORCPT ); Fri, 9 Nov 2012 02:28:19 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 08 Nov 2012 23:28:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,743,1344236400"; d="scan'208";a="246316704" Received: from mint-spring.sh.intel.com ([10.239.36.138]) by fmsmga002.fm.intel.com with ESMTP; 08 Nov 2012 23:28:17 -0800 From: Aaron Lu To: James Bottomley Cc: Alan Stern , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-scsi@vger.kernel.org, Aaron Lu , Aaron Lu Subject: [PATCH v4 2/5] Revert "[SCSI] scsi_pm: set device runtime state before parent suspended" Date: Fri, 9 Nov 2012 15:27:52 +0800 Message-Id: <1352446075-1814-3-git-send-email-aaron.lu@intel.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1352446075-1814-1-git-send-email-aaron.lu@intel.com> References: <1352446075-1814-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 Acked-by: Alan Stern Acked-by: Rafael J. Wysocki --- 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; }