From patchwork Wed Jun 29 13:24:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 9205151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FC9C6075F for ; Wed, 29 Jun 2016 13:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2195C28630 for ; Wed, 29 Jun 2016 13:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1628628665; Wed, 29 Jun 2016 13:29:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA77728630 for ; Wed, 29 Jun 2016 13:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbcF2N3m (ORCPT ); Wed, 29 Jun 2016 09:29:42 -0400 Received: from mga01.intel.com ([192.55.52.88]:35817 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbcF2N3m (ORCPT ); Wed, 29 Jun 2016 09:29:42 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 29 Jun 2016 06:29:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,546,1459839600"; d="scan'208";a="726825430" Received: from ahunter-desktop.fi.intel.com ([10.237.72.168]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jun 2016 06:29:38 -0700 From: Adrian Hunter To: Ulf Hansson Cc: linux-mmc , Alex Lemberg , Mateusz Nowak , Yuliy Izrailov , Jaehoon Chung , Dong Aisheng , Das Asutosh , Zhangfei Gao , Dorfman Konstantin , David Griego , Sahitya Tummala , Harjani Ritesh , Venu Byravarasu Subject: [PATCH V2 06/54] mmc: sdhci-pci: Do not runtime suspend at the end of sdhci_pci_probe() Date: Wed, 29 Jun 2016 16:24:19 +0300 Message-Id: <1467206707-30185-7-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467206707-30185-1-git-send-email-adrian.hunter@intel.com> References: <1467206707-30185-1-git-send-email-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP At the successful conclusion of sdhci_pci_probe(), if runtime pm was allowed, the device would be runtime suspended. That wastes a lot of time during initialization. Instead leave the device active until the mmc core scans for a card. Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci-pci-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 5b03a7ecc6c9..6fbf7086d0b0 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -1768,11 +1768,12 @@ static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) static void sdhci_pci_runtime_pm_allow(struct device *dev) { - pm_runtime_put_noidle(dev); - pm_runtime_allow(dev); + pm_suspend_ignore_children(dev, 1); pm_runtime_set_autosuspend_delay(dev, 50); pm_runtime_use_autosuspend(dev); - pm_suspend_ignore_children(dev, 1); + pm_runtime_allow(dev); + /* Stay active until mmc core scans for a card */ + pm_runtime_put_noidle(dev); } static void sdhci_pci_runtime_pm_forbid(struct device *dev)