From patchwork Tue Jan 13 23:58:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5625071 Return-Path: X-Original-To: patchwork-linux-mmc@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 A1EEAC058D for ; Tue, 13 Jan 2015 23:59:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5B8F2038E for ; Tue, 13 Jan 2015 23:59:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC8E52038D for ; Tue, 13 Jan 2015 23:59:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbbAMX7E (ORCPT ); Tue, 13 Jan 2015 18:59:04 -0500 Received: from mail-ig0-f175.google.com ([209.85.213.175]:60201 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbbAMX7D (ORCPT ); Tue, 13 Jan 2015 18:59:03 -0500 Received: by mail-ig0-f175.google.com with SMTP id h15so19868380igd.2 for ; Tue, 13 Jan 2015 15:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=Y3REbgb46WSLgVoZ/GskySdFG583aAfyjFqpC37WLEQ=; b=VPioeQGJETOSzM7PSoaGs09YiiXvCHQHAbhafh/E6bBpSaEeFWGPbS+ouUPvUVn7Ja w4dnUMKXUjACM9e4bA4EtowV4APgUH6zE3lw4p+ElE5qI8358j5K/yv1XwOHX52e+dAd 1KKytfzCfvqugBfSQ9hlvbvKo9/0kXyoVMQ2E= 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=Y3REbgb46WSLgVoZ/GskySdFG583aAfyjFqpC37WLEQ=; b=HIrtKYpOlXgLAxje79x0Bw1PfDLonRbZW0XyDXF55MCc94+0GfMum9hw1w/h0kT15o +m8lQL1dZ1wF4Z2XXRjVm9Ug6BPo9O2me0z9iCX2AUHJnZzl4y0i214L0Fx57RYuKnj5 hJX+l1JaxdJ4Wu5R7utp8eXLxXh/aVM7j+oKej5b40UxHHekEDqUuofogoRgXxqj4VdT r95pOWlRXWmsJG0I5H9u/5EIc4FwSFZ71R6vml7JQy1WLo9SiJcD1ChPoT+2wmTodkMx C6Lb0ziYBF2rwxUta5rMZd2zv+SJpKfD7mBdBlMb77j3dMqgRRkRJQOv7bP9AJxX046Q /sig== X-Gm-Message-State: ALoCoQnZxesj4sL3BFIPLSJ58UZB4xcRmWZ4D0DkQ4E3c8ZH3LPHn7TlL/nf0oEQzCpsej1Tgwo3 X-Received: by 10.42.65.74 with SMTP id k10mr2158323ici.42.1421193541791; Tue, 13 Jan 2015 15:59:01 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id 5sm11172027iom.7.2015.01.13.15.59.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jan 2015 15:59:01 -0800 (PST) From: Doug Anderson To: Jaehoon Chung , Seungwon Jeon , Ulf Hansson Cc: Alim Akhtar , Sonny Rao , Andrew Bresticker , Heiko Stuebner , amstan@chromium.org, addy.ke@rock-chips.com, yuvaraj.cd@gmail.com, Doug Anderson , chris@printf.net, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmc: dw_mmc: Power on vqmmc in MMC_POWER_ON, not MMC_POWER_UP Date: Tue, 13 Jan 2015 15:58:44 -0800 Message-Id: <1421193524-19967-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 If we power up vqmmc in MMC_POWER_ON then we end up turning it on before mmc_power_up() sets the signal voltage. That's not so great since we might be powering it up at the wrong voltage. Note that this is how Yuvaraj originally coded things up in but he changed it on my suggestion. Apparently I was wrong. Reported-by: Alexandru M Stan Signed-off-by: Doug Anderson --- drivers/mmc/host/dw_mmc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 2e8abc8..4d2e3c2 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1119,6 +1119,12 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) return; } } + set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags); + regs = mci_readl(slot->host, PWREN); + regs |= (1 << slot->id); + mci_writel(slot->host, PWREN, regs); + break; + case MMC_POWER_ON: if (!IS_ERR(mmc->supply.vqmmc) && !slot->host->vqmmc_enabled) { ret = regulator_enable(mmc->supply.vqmmc); if (ret < 0) @@ -1127,10 +1133,6 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) else slot->host->vqmmc_enabled = true; } - set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags); - regs = mci_readl(slot->host, PWREN); - regs |= (1 << slot->id); - mci_writel(slot->host, PWREN, regs); break; case MMC_POWER_OFF: if (!IS_ERR(mmc->supply.vmmc))