From patchwork Mon Jan 23 11:24:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 9532227 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 D6C9560434 for ; Mon, 23 Jan 2017 11:26:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEAAA2768C for ; Mon, 23 Jan 2017 11:26:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C20DF27F10; Mon, 23 Jan 2017 11:26:19 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 D279D2768C for ; Mon, 23 Jan 2017 11:26:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cVclM-0002n7-O2; Mon, 23 Jan 2017 11:26:16 +0000 Received: from dougal.metanate.com ([90.155.101.14] helo=metanate.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVckq-0002Ka-Dc; Mon, 23 Jan 2017 11:25:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=gon4lbo7YMNaG3QxveqHd4g38uIO6iplkVY8msYpgHY=; b=PNlVpoipgaOuBnJp/h5V5cME07wcYWyZNnFiyURsHcxiVCg9aZkCgztfrQnnaU1PxGtfOvDkqv5iuuPNz/z1+T8IrkY0K6TABiukybOp7RG8UI05OHfwwJwJoLjZG55Cn0zc+9MfCLGtQMqAddXaTSVgerTjU4koJPFnK264p399SBYkbF0LeyZIEXYKkToUQE+7HXhpF7j/3ZaBbiHaNP2MpJifsOwnhC8X7tFt8Dm9XnMaKi8KrXbBdv5sH1ZV0cOPPncZHODqYFN2+p1TSU+p5kf/P5gx7NGT7ILMRuoVeIx/ZTV4TCr5d0Ib5xMHygDZdWEIrp6nd6miy7XO3w==; Received: from brian ([192.168.88.1] helo=localhost.localdomain) by shrek.metanate.com with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.83_RC2) (envelope-from ) id 1cVcjj-0000wz-80; Mon, 23 Jan 2017 11:24:35 +0000 Date: Mon, 23 Jan 2017 11:24:32 +0000 From: John Keeping To: Jaehoon Chung Subject: Re: [PATCH] Revert "mmc: dw_mmc-rockchip: add runtime PM support" Message-ID: <20170123112432.08337d26.john@metanate.com> In-Reply-To: References: <1482939288-14950-1-git-send-email-ayaka@soulik.info> <7e37b8ad-39d0-3a94-f75a-2166ae2caf10@samsung.com> <7fb90b9e-75c3-0184-4f0a-d4113899b860@rock-chips.com> <04b667d9-2591-51ff-e024-047bbb6e17c3@rock-chips.com> <6ccade72-ae20-2ffa-1504-2536b9f03adf@soulik.info> <95648282-38f5-42c2-fd8b-ab603eb3a168@gmail.com> <0ccf164f-0d35-9cc3-f288-9b582db23efb@soulik.info> <20afb1da-9e45-f515-01bf-2f5365d20d61@samsung.com> <8f8c66f1-82d6-5151-ff64-ef62596aa10d@rock-chips.com> <2cdd0b6c-a099-595d-1c0b-be7933b0d4a6@collabora.com> Organization: Metanate Ltd X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_032544_795599_4677C252 X-CRM114-Status: GOOD ( 16.14 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulf.hansson@linaro.org, ayaka , Jaehoon Chung , Heiko =?UTF-8?B?U3TDvGJuZXI=?= , linux-mmc@vger.kernel.org, Shawn Lin , xzy.xu@rock-chips.com, Randy Li , Linux Kernel Mailing List , "open list:ARM/Rockchip SoC..." , Romain Perier , Romain Perier , "linux-arm-kernel@lists.infradead.org" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On Fri, 20 Jan 2017 15:08:57 +0900, Jaehoon Chung wrote: > On 01/17/2017 10:38 PM, Romain Perier wrote: > > In my case I can reproduce the issue on the rock2 and the firefly-rk3288. A workaround is to > > > > comment the line ".pm = <&pm_ops_foo>" . > > Sorry for late. I'm checking runtime PM for this. > After that, i will decide whether revert or not. I hit this problem on Rock2 when trying 4.10-rc4. The following patch fixes it for me. I'm not sure if this is safe in general or whether it should be guarded by a quirk that is enabled for RK3288. -- >8 -- Subject: [PATCH] mmc: dw_mmc: restore CIU state on resume At least on RK3288, asserting SDMMC_CTRL_RESET causes the CIU to reset and disable the clock. We need to send SDMMC_CMD_UPD_CLK after doing this in order to avoid the MMC host hanging. Signed-off-by: John Keeping --- drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index b44306b886cb..e7504dabcfb6 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3311,6 +3311,7 @@ int dw_mci_runtime_resume(struct device *dev) { int i, ret = 0; struct dw_mci *host = dev_get_drvdata(dev); + u32 sdmmc_cmd_bits = SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT; if (host->cur_slot && (mmc_can_gpio_cd(host->cur_slot->mmc) || @@ -3357,6 +3358,9 @@ int dw_mci_runtime_resume(struct device *dev) if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) { dw_mci_set_ios(slot->mmc, &slot->mmc->ios); dw_mci_setup_bus(slot, true); + } else { + /* restore CIU */ + mci_send_cmd(slot, sdmmc_cmd_bits, 0); } }