From patchwork Fri Mar 20 18:00:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 6059061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BCC09F2A9 for ; Fri, 20 Mar 2015 18:03:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81A032050B for ; Fri, 20 Mar 2015 18:03:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABA7E204D1 for ; Fri, 20 Mar 2015 18:03:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YZ1EF-0004Af-PD; Fri, 20 Mar 2015 18:01:03 +0000 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YZ1EB-00045M-DY for linux-arm-kernel@lists.infradead.org; Fri, 20 Mar 2015 18:01:00 +0000 Received: by iecvj10 with SMTP id vj10so99257480iec.0 for ; Fri, 20 Mar 2015 11:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=VxUVGuyqF5x/oEBzxHbxaDHCAnqRbEGmlsrQxSGYbB8=; b=aVZ/9IhfGr6FtLgHglPu7A03WObBOLrjj4HP2HrMkhScmTYXql3x7wc4zw1QMjiox/ ALSGs6+Df4wpaCP8kk+SB4GxcxY9WaVrrPepdtj76vd47v5c/KrmadVOKWm4MZCgECDn sse1beemWOyI5DiAYT5E6R4NGO+I3rZOdOD30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VxUVGuyqF5x/oEBzxHbxaDHCAnqRbEGmlsrQxSGYbB8=; b=M7O7HcYqbSXi+jiJb9hOsZI2XUQ05NxS378+1hX4PhLa/VotsmE8CC/Xl96x4mIFNf teTrWFRlDq5SsglKMg7P3aR01dENoZqJG0btxDA6vhdgxxYQ3hb9WdnX8Wcn8O8koCQU CyTzzjtBz4EhmAWuH3Ot2Djp7aoWNZB+wxL5dS8rK9kWOS4mgXRHQBTbGuxprkKI93VN OOHMaFC9NoGVqm4WkjUW8NIc3IigfLPmRo01VMN/zkjZsVpb1uhw3artclEj37YVx6VH c6eZW3piVVwuj030rSib3wBiZjF9oTenp7W3Q1YRv1l73h1K85U/vic2OMVp3SOsBfOp Suew== X-Gm-Message-State: ALoCoQl8nDuMVmiCcxzAJBqXN9vNoWcfOtuc+39CFLmpDMLKE10n0D+1I0tFQ2WUTlTDG1QPlL9L X-Received: by 10.43.77.6 with SMTP id zg6mr5918374icb.68.1426874438048; Fri, 20 Mar 2015 11:00:38 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id x9sm1551670igl.2.2015.03.20.11.00.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 11:00:36 -0700 (PDT) From: Doug Anderson To: Jaehoon Chung , Seungwon Jeon , Ulf Hansson Subject: [PATCH] mmc: dw_mmc: Don't send clock off command if power is off Date: Fri, 20 Mar 2015 11:00:20 -0700 Message-Id: <1426874420-25103-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150320_110059_533294_6D7C9097 X-CRM114-Status: GOOD ( 10.86 ) X-Spam-Score: -0.8 (/) Cc: Addy Ke , Heiko Stuebner , Andrew Bresticker , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Doug Anderson , chris@printf.net, linux-rockchip@lists.infradead.org, Alim Akhtar , Sonny Rao , javier.martinez@collabora.co.uk, linux-arm-kernel@lists.infradead.org, Alexandru Stan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We've already seen that it causes failures if we try to send the "SDMMC_CMD_UPD_CLK" command when power is off to the system. Here's another case where we were doing it: we were sending an SDMMC_CMD_UPD_CLK to set the clock to 0 when the card was already powered off and the clock was already at 0. Let's avoid that command and avoid problems. Signed-off-by: Doug Anderson --- drivers/mmc/host/dw_mmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 47dfd0e..aeec698 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1172,8 +1172,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) break; case MMC_POWER_OFF: - /* Turn clock off before power goes down */ - dw_mci_setup_bus(slot, false); + /* Turn clock off before power goes down; only if powered */ + if (slot->host->vqmmc_enabled) + dw_mci_setup_bus(slot, false); if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);