From patchwork Thu Jan 4 15:30:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 10144979 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 975F9605BD for ; Thu, 4 Jan 2018 15:31:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89F7D287AB for ; Thu, 4 Jan 2018 15:31:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 886C928569; Thu, 4 Jan 2018 15:31:07 +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=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID 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 1FEB3287C1 for ; Thu, 4 Jan 2018 15:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753287AbeADPbF (ORCPT ); Thu, 4 Jan 2018 10:31:05 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:45877 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbeADPbE (ORCPT ); Thu, 4 Jan 2018 10:31:04 -0500 Received: by mail-wr0-f195.google.com with SMTP id o15so1788023wrf.12 for ; Thu, 04 Jan 2018 07:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yb+Eae9gxT+wRNvXDNakVtNuhkYYxKYBFkDnmEZB3u4=; b=EeEfx5wfabdiqwtFzVyxMCmkcxR4cG0G/GHdACeStc+YznKxmnwvKW5TUroXYDXEGD YLha4Fb9uWo+dDfR6CJ24rj53EFAQ07WyyLdcGpoRJR3Qxn6a0W2Sx2gQgTjyI2KUh9a 3Dokg04ijgT9rH6hj5TKuCmZvivq1p8ccf20xhXoZ0gApPRBS26iZqjBKePp10X4FyHt F45OA6Rlp41yZMeZw7J/+09wCtEyt4sacJGsTx139LSKJuEGI0djVybvhMqMTXMHyoUQ M7qv1o//Xz3uHg3ML935zwu3uvErPTdtyLJ3csxlg1wt2cMUBr9BMIdqnPYZgSHR0iSj tE0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Yb+Eae9gxT+wRNvXDNakVtNuhkYYxKYBFkDnmEZB3u4=; b=O20nZPaR2ml9ICERrATsZhPpsV0igoge93gm7Lj1K2kKsG+xwCfBZ4U7g4eRZ5Jobq zzrKTsIKSa/VNqkCgFC2v5pKyNnImT00FqIP4gMKrv3SoxdVK3qYLiY/q5DCPwPt1Zkj isie686JAHmepyl5WvSDHW8OFgmlQlIFX1tpTQXTfJY3uX+/5BVBykLdO8PMqV4REYTn QcUab4IWs3Lw8YaSl5z+7M8CD0i7V7wUt75CKVOvHioHRmuBc+Rg3WRFSG8Hmy6TZZTU GmCwcxNnldDrlX0Lt4usmmR3oVKw/9/Kznqbm68PLzobqs5K7stByi9JGeu/fK3W5xNb ip+Q== X-Gm-Message-State: AKGB3mIHXKrxsSd9l9UsmNEyxPTS9qMRZnzf8Q0+s88Pi39hppwtNOy5 h6Zy5Q/e2qd/uVJgl0SJhTZDeA== X-Google-Smtp-Source: ACJfBouTob7/IC2TrprIWr9Q2wTagqCwvRijM0UrglUZ18eq5EiXD871XoC5xLW1AG9yvcxnm9uDkw== X-Received: by 10.223.196.71 with SMTP id a7mr5325360wrg.158.1515079863690; Thu, 04 Jan 2018 07:31:03 -0800 (PST) Received: from localhost.localdomain ([5.170.79.192]) by smtp.gmail.com with ESMTPSA id b48sm9482358wrb.1.2018.01.04.07.31.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 07:31:02 -0800 (PST) From: Michael Trimarchi To: Ulf Hansson Cc: Michael Trimarchi , linux-mmc@vger.kernel.org, Adrian Hunter Subject: [PATCH 2/3] mmc: sdhci-esdhc-imx: Changes the order of how clocks are being re-enabled Date: Thu, 4 Jan 2018 16:30:58 +0100 Message-Id: <1515079859-18401-2-git-send-email-michael@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515079859-18401-1-git-send-email-michael@amarulasolutions.com> References: <1515079859-18401-1-git-send-email-michael@amarulasolutions.com> 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 runtime_resume() should re-enable the clocks in reverse order comparing with runtime_suspend() Signed-off-by: Michael Trimarchi --- drivers/mmc/host/sdhci-esdhc-imx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d08c21e..6d4e323 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1411,31 +1411,33 @@ static int sdhci_esdhc_runtime_resume(struct device *dev) struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); int err; + err = clk_prepare_enable(imx_data->clk_ahb); + if (err) + return err; + if (!sdhci_sdio_irq_enabled(host)) { err = clk_prepare_enable(imx_data->clk_per); if (err) - return err; + goto disable_ahb_clk; err = clk_prepare_enable(imx_data->clk_ipg); if (err) goto disable_per_clk; } - err = clk_prepare_enable(imx_data->clk_ahb); - if (err) - goto disable_ipg_clk; + err = sdhci_runtime_resume_host(host); if (err) - goto disable_ahb_clk; + goto disable_ipg_clk; return 0; -disable_ahb_clk: - clk_disable_unprepare(imx_data->clk_ahb); disable_ipg_clk: if (!sdhci_sdio_irq_enabled(host)) clk_disable_unprepare(imx_data->clk_ipg); disable_per_clk: if (!sdhci_sdio_irq_enabled(host)) clk_disable_unprepare(imx_data->clk_per); +disable_ahb_clk: + clk_disable_unprepare(imx_data->clk_ahb); return err; } #endif