From patchwork Sat Dec 20 13:18:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 5522621 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4719DBEEA8 for ; Sat, 20 Dec 2014 13:19:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3DB602013D for ; Sat, 20 Dec 2014 13:19:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24FDF20131 for ; Sat, 20 Dec 2014 13:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbaLTNTh (ORCPT ); Sat, 20 Dec 2014 08:19:37 -0500 Received: from mail-yk0-f176.google.com ([209.85.160.176]:59919 "EHLO mail-yk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752969AbaLTNTg (ORCPT ); Sat, 20 Dec 2014 08:19:36 -0500 Received: by mail-yk0-f176.google.com with SMTP id q200so1130763ykb.21 for ; Sat, 20 Dec 2014 05:19:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VfezpeKkpXM3HIpcDTUFNxHBwdlz78h9sOj04g82m0A=; b=a1Keyyj1wRuUiKvJi8Yphfz//H8se2ZrpgbBOv3bUgjgIfIpfBZ1AzVTWrs7fMX48X qeYnlrwnLwy7f9u3l8BUtdzioDD9hhln49Ky4s29WlidHAh+KNtEflmJ75VL08wZXqLt rY036sXy0fBAW6KiIFLPDRgXgUy/4PMK6xgpr72lZgKM6Z4eaneKhO8tR56ecftwCRWZ ecVxrxD66u79l5/Gi9Rf/63KJ78lhiocGWVZY3wT7ypv2K0p4D4mkjqhuRhgwBPJvEk9 wgkAL8vAbotU66hE2vs+zhCpTKmKgG0pEfeOrcFBfjhNqSVNlJQ44AeO8HBccm52rSvO 31RQ== X-Received: by 10.236.66.236 with SMTP id h72mr10336236yhd.153.1419081575686; Sat, 20 Dec 2014 05:19:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.170.62.195 with HTTP; Sat, 20 Dec 2014 05:18:55 -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> From: Alim Akhtar Date: Sat, 20 Dec 2014 18:48:55 +0530 Message-ID: Subject: Re: [PATCH v2 3/4] mmc: dw_mmc: Convert to mmc_send_tuning() To: Ulf Hansson 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: 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Hi Ulf, On Mon, Dec 8, 2014 at 3:40 PM, Ulf Hansson wrote: > 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; > -- > 1.9.1 > Sorry for delay in testing this suggested patch, I would say this certainly helps, but still I need to change sample phase to make it work with generic tuning function. So with your's adding STOP_TRANSMISSION command and below change, HS200 works well on exynos5800 I didn't find anything is exynos documentations which suggest STOP_TRANSMISSION is needed, may be Seungwon might be know as he wrote this. Are you ok to add STOP_TRANSMISSION in generic tuning code (probably with a quirk, so that other hosts are still happy)? If so, I can send the above DT change as a fix. > Kind regards > Uffe diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts index e8fdda8..e0f0337 100644 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts @@ -555,7 +555,7 @@ card-detect-delay = <200>; clock-frequency = <400000000>; samsung,dw-mshc-ciu-div = <3>; - samsung,dw-mshc-sdr-timing = <0 4>; + samsung,dw-mshc-sdr-timing = <2 4>; This basically change the clock-sample phase with which the tuning process starts.