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: 6059031 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD8C2BF90F for ; Fri, 20 Mar 2015 18:01:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0F892050B for ; Fri, 20 Mar 2015 18:01:17 +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 0BEDA204D1 for ; Fri, 20 Mar 2015 18:01:17 +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 1YZ1ES-0004EX-3H; Fri, 20 Mar 2015 18:01:16 +0000 Received: from mail-ig0-x232.google.com ([2607:f8b0:4001:c05::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YZ1EB-00045P-KB for linux-rockchip@lists.infradead.org; Fri, 20 Mar 2015 18:01:00 +0000 Received: by igcau2 with SMTP id au2so423988igc.1 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=T9I5GrF184cuh767XRGjU2xrh1kYyT7lbYs1K4aPP9/+o1S6L5bZ3ZI+0DB5pUi/7e ifqr+Sj8Pw4teKJuEoNR0dUCreJLgQg15Ow0diDLdOtfGIiU7ObvB0a/pFzqmqsFgGo6 t7u/Xt5t1P2SsCsxGDYwt9/xrZHILBuQvsukJ/udUF/kSD8ZpntzCT7IBAAPGdzyFmlo cD6R04WVLuQ7EH1HYKGZOtqIZ6Po1zngXh4d6wqPBfNHW4arwKqgLmNmCPPGZF9PpxVq yvuFhqSPpSYBA7Oa6BTlqcMpiSHKt4Hry4Cewed6PI9wcIycat6Vg7uknfIqw6c8VCYb +6JQ== X-Gm-Message-State: ALoCoQkBPN8KNygbTkfK3seomlC02RcOYabBM3ZhA2JWKmsHDtb7xDzkJ9em5KddJHoZ/22YmbCc 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_774009_94F3462A X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. 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-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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);