From patchwork Mon Dec 8 10:10:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 41994 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7E2D2202E0 for ; Mon, 8 Dec 2014 10:10:13 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id n15sf2525418lbi.4 for ; Mon, 08 Dec 2014 02:10:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=eyZcMcmRxOiA05CWOOCYQPie/mJIxwMiXxbWJ1TuMQA=; b=N40V915ps7Omjd9uWOQ0qlWg0mh1GF9LpSlZTV1/2d2Yt2vUUiubarLZlKy6f3jVML NWtwcw72ULfyw+Rf+aAihG0Zg+ZFWqniofUDMYBuHLt3jBuw2UEi+xyl+NysEJZJnqVZ iO0SF3bput2xjvZC6gXCnJMt4CRLbwBjKmWOvaUv1ho+BjgScSbJZwoV1pWTYjlDZ+l2 GBkDY3EPYC63Wtj/Tf1fVHlRp7ETAWygKyuWcON+9bjM5Kf1mP35w3VRX67GGp6pEIJg QKu9Tx3a/TvEbJIBGPvO6Q9ambiaddpZsA7VcSevD5Qvi5/9RMeibjIgiOQpZO9GRIFb ibdQ== X-Gm-Message-State: ALoCoQn55S0DCTkzZOZzvre2kl0mjVEPOpWj6VZ+xK9B6qsOZ4QGzo2gWNH8HfMyhj7ey8hnhxVy X-Received: by 10.180.189.116 with SMTP id gh20mr3308295wic.2.1418033412410; Mon, 08 Dec 2014 02:10:12 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.100 with SMTP id 4ls656728lal.89.gmail; Mon, 08 Dec 2014 02:10:12 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr15599167lbc.34.1418033412144; Mon, 08 Dec 2014 02:10:12 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id p3si36504095laj.83.2014.12.08.02.10.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Dec 2014 02:10:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id pv20so3670043lab.27 for ; Mon, 08 Dec 2014 02:10:11 -0800 (PST) X-Received: by 10.112.173.202 with SMTP id bm10mr15174661lbc.74.1418033411761; Mon, 08 Dec 2014 02:10:11 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp579074lbc; Mon, 8 Dec 2014 02:10:10 -0800 (PST) X-Received: by 10.70.19.101 with SMTP id d5mr19736838pde.10.1418033409873; Mon, 08 Dec 2014 02:10:09 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rx10si59345032pab.77.2014.12.08.02.10.09 for ; Mon, 08 Dec 2014 02:10:09 -0800 (PST) Received-SPF: none (google.com: linux-mmc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753514AbaLHKKH (ORCPT + 3 others); Mon, 8 Dec 2014 05:10:07 -0500 Received: from mail-qc0-f171.google.com ([209.85.216.171]:42418 "EHLO mail-qc0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752717AbaLHKKG (ORCPT ); Mon, 8 Dec 2014 05:10:06 -0500 Received: by mail-qc0-f171.google.com with SMTP id r5so3242853qcx.2 for ; Mon, 08 Dec 2014 02:10:05 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.85.104 with SMTP id m95mr48286713qgd.93.1418033405431; Mon, 08 Dec 2014 02:10:05 -0800 (PST) Received: by 10.96.216.199 with HTTP; Mon, 8 Dec 2014 02:10:05 -0800 (PST) In-Reply-To: References: <1417780783-12939-1-git-send-email-ulf.hansson@linaro.org> <1417780783-12939-4-git-send-email-ulf.hansson@linaro.org> Date: Mon, 8 Dec 2014 11:10:05 +0100 Message-ID: Subject: Re: [PATCH v2 3/4] mmc: dw_mmc: Convert to mmc_send_tuning() From: Ulf Hansson To: Alim Akhtar Cc: "linux-mmc@vger.kernel.org" , Chris Ball , Seungwon Jeon , Jaehoon Chung , Shawn Guo , Sascha Hauer , Aisheng Dong , Stephen Boyd , Minda Chen , Barry Song Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 6 December 2014 at 13:43, Alim Akhtar wrote: > Hi Ulf, > > On Fri, Dec 5, 2014 at 5:29 PM, Ulf Hansson wrote: >> Instead of having a local hack taking care of sending the tuning >> command and as well to verify the response pattern, let's convert to >> the common mmc_send_tuning() API. >> >> This change affects the Exynos variant, since it's the only one which >> support the dw_mmc's ->execute_tuning() callback. >> >> Signed-off-by: Ulf Hansson >> --- >> Alim, thanks for helping out testing! > With this change HS200 mode does not work on exynos5800 peach-pi board. > I got below error while testing this series: > > mmc0: tuning execution failed > mmc0: error -5 whilst initialising MMC card > > Though, your's next branch with commit _a1d06b4_ works fine in HS200 mode. I was looking into the details of what change my patchset introduces for dw_mmc-exynos. Apparently, dw_mmc-exynos was using the MMC_STOP_TRANSMISSION to end the tuning reqeust (CMD21/19). The new mmc_send_tuning() API doesn't, which also conforms to what the eMMC/SD specifications states. Do you have any idea of why dw_mmc-exynos was using MMC_STOP_TRANSMISSION for CMD19/21? To see if my theory is correct, could you try out the following patch on top of $subject patch? BTW, I have queued patch 1 and 2, from this patchset available on my next branch. >From e1ac35bb0e90254275ec7088f41e6e2d59e48367 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Mon, 8 Dec 2014 10:58:48 +0100 Subject: [PATCH] mmc: core: End tuning request with stop command Not to be merged! This patch adds the MMC_STOP_TRANSMISSION command to end a tuning request. For some reason dw_mmc seems to need this to complete the tuning request without errors. Signed-off-by: Ulf Hansson --- drivers/mmc/core/mmc_ops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 3b044c5..aa79e0c 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -551,6 +551,7 @@ int mmc_send_tuning(struct mmc_host *host) { struct mmc_request mrq = {NULL}; struct mmc_command cmd = {0}; + struct mmc_command stop = {0}; struct mmc_data data = {0}; struct scatterlist sg; struct mmc_ios *ios = &host->ios; @@ -576,10 +577,14 @@ int mmc_send_tuning(struct mmc_host *host) mrq.cmd = &cmd; mrq.data = &data; + mrq.stop = &stop; cmd.opcode = opcode; cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + stop.opcode = MMC_STOP_TRANSMISSION; + stop.flags = MMC_RSP_R1B | MMC_CMD_AC; + data.blksz = size; data.blocks = 1; data.flags = MMC_DATA_READ;