From patchwork Mon Apr 16 14:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10343065 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 DC3926039A for ; Mon, 16 Apr 2018 14:27:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7DF9286F3 for ; Mon, 16 Apr 2018 14:27:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B71D2286F7; Mon, 16 Apr 2018 14:27:38 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E887286F3 for ; Mon, 16 Apr 2018 14:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Al5IwwiHQLIr12NaLuOd2yGD9lYVX7JKy6fsufKxpHE=; b=kBaDCGPwnrtc95l+wgnVzjYZb1 VY+rvTfpG+1ii9CvrFm5oXcgkRIrLAkjmIk2ESRpEn9dZGa+9qORQGYRUMgqwbtQnVQmWgcjocrbE fdAojE1p1owRjHbEY2EiTAThVWA41s5H8SZWOx+gEUEAZ+39svkhcgWZogj/RGCrkN4kO1QyEU8k5 RoewEJJhP/VfMb34LlhTMpVRUnTbG1/zry1kb3eI+hfMyBaS7sbIsbFOQkXC8pnh19gGdRCSM6eln 24jCD0pIvNB5c4wL6e6zuOas78UQHipqmP4wdMxsq6WrTv8TqoWj3SQvGK6gm+bkDfAz5JrpBrl9L lzoeJKpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f856Q-0000PY-5W; Mon, 16 Apr 2018 14:27:30 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f852n-0005WU-9M for linux-arm-kernel@lists.infradead.org; Mon, 16 Apr 2018 14:23:50 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 345F620DC1; Mon, 16 Apr 2018 16:23:21 +0200 (CEST) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id F0F7920DC3; Mon, 16 Apr 2018 16:23:10 +0200 (CEST) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , ulf.hansson@linaro.org Subject: [PATCH v3 7/7] mmc: sunxi: Drop the init / reset of the controller from set_ios Date: Mon, 16 Apr 2018 16:23:05 +0200 Message-Id: <68af0c20ec99bda4af61d413e5feee75f0577292.1523888566.git-series.maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180416_072345_524176_8E3CCB0E X-CRM114-Status: GOOD ( 13.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , linux-mmc@vger.kernel.org, Quentin Schulz , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Our set_ios hook is, when the card is power up or down, either doing a full init or put our controller back into a reset mode. Since we're also doing that in our runtime_pm hooks, and at possibly much more often, we can drop it from the set_ios, and either rely on our runtime_pm hooks or our probe to do it. Signed-off-by: Maxime Ripard --- drivers/mmc/host/sunxi-mmc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 0253deb153a4..97c6b79b7d6f 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -939,14 +939,7 @@ static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) { struct sunxi_mmc_host *host = mmc_priv(mmc); - if (ios->power_mode == MMC_POWER_OFF) - sunxi_mmc_reset_host(host); - sunxi_mmc_card_power(host, ios); - - if (ios->power_mode == MMC_POWER_UP) - sunxi_mmc_init_host(host); - sunxi_mmc_set_bus_width(host, ios->bus_width); sunxi_mmc_set_clk(host, ios); } @@ -1401,6 +1394,10 @@ static int sunxi_mmc_probe(struct platform_device *pdev) if (ret) goto error_free_dma; + ret = sunxi_mmc_init_host(host); + if (ret) + goto error_free_dma; + pm_runtime_set_active(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, 50); pm_runtime_use_autosuspend(&pdev->dev);