From patchwork Fri May 30 17:13:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31204 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E3B9B20671 for ; Fri, 30 May 2014 17:13:41 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id fp1sf4648075pdb.10 for ; Fri, 30 May 2014 10:13:41 -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=o4bSR2zncReRXZKt1HSJ8JvatIkcXCcSm/JVWsV3RcA=; b=O9/MxIvrFvFr65kTPIjqr7JdB0sXGIq0mdS98FCRDhveXNzjxbVcX6G7RRF894u/LQ u+e4/y/jhAtwYvr1DN9Hk57/bFAtA6rfOP4BxYzzKZldld1bnADI2srCJOkaDW1ahjhQ b25t3WOJfYrppHwqFj7iWrWV3sx1mwMEp2fCYtmu+JbTft+XW42rsInCmMg74psFrt5H ftbkPsV2r9WH0HyttQwTmKFUz/OcCkGT7HbITY2oKv2eWxqYk65y2xzhgkW0BbTvU1VC S0zBBCV5t4O0PbJtkJ/q2qYwl6+6oRNMj3ZZKBDfDkfMoZT9tVkEAXygi4aGg0rkY20p hhZQ== X-Gm-Message-State: ALoCoQnP3Yt8JN2TU7wZjPEvDANLCIDjuJLDo97oGoRyTELPJC0yP7ywcKA7bSK6/Ynk2su49VMF X-Received: by 10.66.235.170 with SMTP id un10mr4923716pac.37.1401470021132; Fri, 30 May 2014 10:13:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.180 with SMTP id w49ls1105381qge.3.gmail; Fri, 30 May 2014 10:13:40 -0700 (PDT) X-Received: by 10.52.12.129 with SMTP id y1mr2911715vdb.59.1401470020928; Fri, 30 May 2014 10:13:40 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id s1si3574132vep.80.2014.05.30.10.13.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 May 2014 10:13:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id oz11so2463188veb.17 for ; Fri, 30 May 2014 10:13:40 -0700 (PDT) X-Received: by 10.58.185.165 with SMTP id fd5mr3494635vec.41.1401470020730; Fri, 30 May 2014 10:13:40 -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 ib8csp128226vcb; Fri, 30 May 2014 10:13:40 -0700 (PDT) X-Received: by 10.66.224.38 with SMTP id qz6mr19963818pac.153.1401470019962; Fri, 30 May 2014 10:13:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id go6si6444316pac.116.2014.05.30.10.13.39; Fri, 30 May 2014 10:13:39 -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 S934292AbaE3RN2 (ORCPT + 28 others); Fri, 30 May 2014 13:13:28 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:53191 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934174AbaE3RNZ (ORCPT ); Fri, 30 May 2014 13:13:25 -0400 Received: by mail-we0-f170.google.com with SMTP id u57so2395305wes.1 for ; Fri, 30 May 2014 10:13:24 -0700 (PDT) X-Received: by 10.180.76.179 with SMTP id l19mr8613199wiw.43.1401470003942; Fri, 30 May 2014 10:13:23 -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 y10sm7466470wix.24.2014.05.30.10.13.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 May 2014 10:13:23 -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 v5 04/13] mmc: mmci: Add enough delay between writes to CMD register. Date: Fri, 30 May 2014 18:13:20 +0100 Message-Id: <1401470000-26989-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401469918-26817-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1401469918-26817-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.172 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 a38e714..ed20bf5 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -810,7 +810,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;