From patchwork Wed May 28 13:46:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31063 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53B4120068 for ; Wed, 28 May 2014 13:46:52 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id sa20sf44189368veb.5 for ; Wed, 28 May 2014 06:46:52 -0700 (PDT) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=t56cc0y5kd+9OO4a1tJZq0M+/z55xTBgKIR67MBAuaA=; b=XgLaBDdgaPkgtZ44wc8kHXkeMVB4ib4xDrUGd3bhcpottviVgDlTYUUR6Lcx+SutJM EETUIicaHCo/MF35t6ORv2NO7XLczAS3zHOA4VYphqsZ9mVnv93N2Sg83cazVSsRTfDU EKj76v8GMO1PK0lRUJCi27hvfTJuRTbcbiL/X8ZgBXUt3FOm2yZ4sv0f2lDK4RIjUniX qlXG2LxuuxIZq1LK5exIiP3Hl2X5MovOOr5jOokvXrANRYNaqTtEQURAq5gu96pzexkt eIWuMlV0qkJsT6GJlUjivfZlPgIb6XZhhWImToyfo8OC8bS2EFniTGyt1YpdIJyen/vm h6YA== X-Gm-Message-State: ALoCoQnJ8jBH7GMadvJ8cb+TvUWEfDAk9l2X6FSHge+KWPd3pZM4/l3PDBY/HPvapxlFKAck48x9 X-Received: by 10.224.104.2 with SMTP id m2mr16165460qao.7.1401284812037; Wed, 28 May 2014 06:46:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.72 with SMTP id k66ls95084qgd.96.gmail; Wed, 28 May 2014 06:46:51 -0700 (PDT) X-Received: by 10.221.30.14 with SMTP id sa14mr1509509vcb.44.1401284811883; Wed, 28 May 2014 06:46:51 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id g7si10584839vek.12.2014.05.28.06.46.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 06:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so12430849veb.39 for ; Wed, 28 May 2014 06:46:51 -0700 (PDT) X-Received: by 10.52.170.237 with SMTP id ap13mr15119452vdc.27.1401284811778; Wed, 28 May 2014 06:46:51 -0700 (PDT) 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.220.221.72 with SMTP id ib8csp204329vcb; Wed, 28 May 2014 06:46:51 -0700 (PDT) X-Received: by 10.66.102.102 with SMTP id fn6mr25536011pab.6.1401284810965; Wed, 28 May 2014 06:46:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id th10si23912978pab.18.2014.05.28.06.46.50 for ; Wed, 28 May 2014 06:46:50 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1754011AbaE1Nqg (ORCPT + 27 others); Wed, 28 May 2014 09:46:36 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:60400 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbaE1Nqd (ORCPT ); Wed, 28 May 2014 09:46:33 -0400 Received: by mail-wg0-f46.google.com with SMTP id n12so11000034wgh.17 for ; Wed, 28 May 2014 06:46:32 -0700 (PDT) X-Received: by 10.180.14.72 with SMTP id n8mr48498431wic.53.1401284791894; Wed, 28 May 2014 06:46:31 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-149-4-211.as13285.net. [78.149.4.211]) by mx.google.com with ESMTPSA id ho2sm17031403wib.15.2014.05.28.06.46.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 May 2014 06:46:31 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Russell King , Ulf Hansson , linux-mmc@vger.kernel.org Cc: Chris Ball , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linus.walleij@linaro.org, Srinivas Kandagatla Subject: [PATCH v4 04/13] mmc: mmci: Add enough delay between writes to CMD register. Date: Wed, 28 May 2014 14:46:26 +0100 Message-Id: <1401284786-16604-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401284608-16428-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1401284608-16428-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@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.128.180 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: , From: Srinivas Kandagatla On Qcom SD Card controller POWER, CLKCTRL, DATACTRL and COMMAND registers should be updated in MCLK domain, and writes to these registers must be separated by three MCLK cycles. This resitriction is not applicable for other registers. Any subsequent writes to these register will be ignored until 3 MCLK have passed. One usec delay between two CMD register writes is not sufficient in the card identification phase where the CCLK is very low. This patch replaces a static 1 usec delay to use mmci_reg_delay function which can provide correct delay depending on the cclk frequency. Without this patch the card is not detected. Signed-off-by: Srinivas Kandagatla --- drivers/mmc/host/mmci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 86f25a9..aa2d381 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -818,7 +818,7 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) if (readl(base + MMCICOMMAND) & MCI_CPSM_ENABLE) { writel(0, base + MMCICOMMAND); - udelay(1); + mmci_reg_delay(host); } c |= cmd->opcode | MCI_CPSM_ENABLE;