From patchwork Mon Feb 2 16:00:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 44157 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1D5A2034D for ; Mon, 2 Feb 2015 16:01:05 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id u56sf16935109wes.2 for ; Mon, 02 Feb 2015 08:01:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bwELa1OaxYzT1iwgffyF2G7E6EAQsLjK7cWhA/Cb3jw=; b=AFPogpDJrOnQ/+p2x5ljb75BitaofU7ZEIxk1rfiUXzzXglMSAvqAySHjtBPvOzj7d cMPgiO0lDbItM0W9gFDxpASL/3H0z86+o9TrHLUnfB6C9PHhdYDBJJrr7L7KKryeFvl0 Pl1m+IThUnZRDu1ytT9YmvgfnTdvIm4aIZF/X8ARa8Uw8Iz098e0oqFhDoxUeYNu5XEI z0h5YngbZ1OfOQIansXbGJyNKTJtfG2qwnkpu4LIBtMNz3DksOuNO9VEqyb+9yvKaZZC rEdM/XAUs6JfJA+htGnFsWCPKCYAhJkXRS/1Al/5uar7SEzy+ivGJRyQAaBa3fH6tPQX CmEA== X-Gm-Message-State: ALoCoQnMwPMg04JNpxXnb3jPYDFz9blTnDLsvezU8hLxA9lXRg3Uab3B20l5dAId6Ez1kz1mRuSW X-Received: by 10.152.36.168 with SMTP id r8mr2497057laj.2.1422892864817; Mon, 02 Feb 2015 08:01:04 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.6 with SMTP id i6ls634414lam.10.gmail; Mon, 02 Feb 2015 08:01:04 -0800 (PST) X-Received: by 10.152.234.230 with SMTP id uh6mr19539804lac.97.1422892864670; Mon, 02 Feb 2015 08:01:04 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id mt5si17271466lbb.59.2015.02.02.08.01.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Feb 2015 08:01:04 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id s18so42450433lam.5 for ; Mon, 02 Feb 2015 08:01:04 -0800 (PST) X-Received: by 10.152.23.195 with SMTP id o3mr20355660laf.70.1422892864557; Mon, 02 Feb 2015 08:01:04 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1381872lbj; Mon, 2 Feb 2015 08:01:03 -0800 (PST) X-Received: by 10.112.188.227 with SMTP id gd3mr20175201lbc.22.1422892863934; Mon, 02 Feb 2015 08:01:03 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id qz8si17219601lbc.116.2015.02.02.08.01.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Feb 2015 08:01:03 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id pv20so42188049lab.7 for ; Mon, 02 Feb 2015 08:01:03 -0800 (PST) X-Received: by 10.112.167.228 with SMTP id zr4mr20364484lbb.20.1422892863776; Mon, 02 Feb 2015 08:01:03 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id jf3sm4484214lbc.44.2015.02.02.08.01.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Feb 2015 08:01:02 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: linux-arm-kernel@lists.infradead.org, Arend van Spriel , Sascha Hauer , Olof Johansson , Russell King , Hans de Goede , Doug Anderson , NeilBrown , Tomeu Vizoso , Javier Martinez Canillas , Ulf Hansson Subject: [PATCH] mmc: core: Invoke mmc_pwrseq_post_power_on() prior MMC_POWER_ON state Date: Mon, 2 Feb 2015 17:00:54 +0100 Message-Id: <1422892854-3655-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Host drivers have different ways to sends their "init stream" to the card. Some need to do it as part of a request, some do it from the ->set_ios() callback in the MMC_POWER_ON state and some don't send an "init stream" at all. To be able to use the reset GPIOs from the simple MMC power sequence provider, the card need to be powered and the "init stream" must not have been sent. To cope with these requirements, invoke mmc_pwrseq_post_power_on() prior we change the state to MMC_POWER_ON in mmc_power_up(). Host drivers shall perform power up operations in the MMC_POWER_UP state. Unfortunate three hosts (au1xmmc, cb710-mmc and toshsd) don't conform to this expectation. Instead those ignore the MMC_POWER_UP state and delays their power up operations to the MMC_POWER_ON state. Those hosts needs to change their behavior to enable proper support for the simple MMC power sequence provider. Signed-off-by: Ulf Hansson --- Some background to this patch: http://marc.info/?t=142165904000001&r=1&w=2 --- drivers/mmc/core/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 0dc64e6..23f10f7 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1637,6 +1637,8 @@ void mmc_power_up(struct mmc_host *host, u32 ocr) */ mmc_delay(10); + mmc_pwrseq_post_power_on(host); + host->ios.clock = host->f_init; host->ios.power_mode = MMC_POWER_ON; @@ -1648,8 +1650,6 @@ void mmc_power_up(struct mmc_host *host, u32 ocr) */ mmc_delay(10); - mmc_pwrseq_post_power_on(host); - mmc_host_clk_release(host); }