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: 5763031 Return-Path: X-Original-To: patchwork-linux-arm@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 B0D69BF440 for ; Mon, 2 Feb 2015 16:03:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9266B20452 for ; Mon, 2 Feb 2015 16:03:28 +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 AD2252041B for ; Mon, 2 Feb 2015 16:03:27 +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 1YIJRM-0005Rm-AM; Mon, 02 Feb 2015 16:01:32 +0000 Received: from mail-la0-f54.google.com ([209.85.215.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YIJRG-0005Kp-20 for linux-arm-kernel@lists.infradead.org; Mon, 02 Feb 2015 16:01:30 +0000 Received: by mail-la0-f54.google.com with SMTP id hv19so42132815lab.13 for ; Mon, 02 Feb 2015 08:01:03 -0800 (PST) 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=bwELa1OaxYzT1iwgffyF2G7E6EAQsLjK7cWhA/Cb3jw=; b=GS68FYfs+K+MxwTxGzMyQ2NZ683hMM5OWe2rDqC5IbGiafZO5Kh2UnqtpU9TKHV08i fAvVpHUkuqXUHhd+KCiWcp3kkw/k7BCi8WeU1AhX7zeSZ3m9PVjcv41yJvWLO+dxESku 297NP14mjiJj5gIAo/alCkkeEa8XxGmJfv4Oa5eNnR91GkVkr28v2fZ4gNGS6heoGdv8 OciU/iRpmgecaagww0kNAS/ZJbW5qi/gv17nyffLTfugGI2CK3UxQCAutEcX6wN9IyFE rEOxHlJrtYOVhUPobD05mWnBLPJPKKxg8kP5al1WA849oyzaVULAFp42kx4ls1bXKgQ6 Osdg== X-Gm-Message-State: ALoCoQnTbdV0vRMCdQRfLKxZ6p7nxNSXM8kSLgyxRa8cBTzI91fWGQ9nQ3lBb4kN9m6aCqLYTo0a 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150202_080126_322251_12277C7F X-CRM114-Status: GOOD ( 12.88 ) X-Spam-Score: -0.7 (/) Cc: Ulf Hansson , Russell King , Tomeu Vizoso , Hans de Goede , NeilBrown , Sascha Hauer , Doug Anderson , Olof Johansson , Arend van Spriel , Javier Martinez Canillas , linux-arm-kernel@lists.infradead.org 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 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 Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas --- 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); }