From patchwork Mon Jun 2 09:08:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 12C73203C2 for ; Mon, 2 Jun 2014 09:09:21 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id w10sf14996006pde.1 for ; Mon, 02 Jun 2014 02:09:21 -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=EFJS1OWSSGvb0Nua+kxI391OwZfDx5y2Kk6v9RAkYLSikD6u4dwBh+kJgZXwXA9utt jvpDTF9q2Gj3jvc7Zz2HQGFTFf9TYEcRBenZRBL1cQaxpHAd4CJ5GhcMYeFlqmaYheyH /Mnv0nH5yVFZFo88X+q7wAaXVIPNG3Z2+sfFjRrLOvBTc0kw0bpUkS2q8g7Bo9ohr6kE IvDwb1p6EgQu/0l9rFAJ3jNA619OFCO0F5qxNI/CULt9RXkJtbGKWjQRTC/RLE+I5B6i 0JI6UxcueUXHWeZ0g8HrQUhAjd/YilrsdTVLPy1F9qcfkgdsqR3lxFGhS8ZOFJuYhBDZ gyWA== X-Gm-Message-State: ALoCoQlYYU2KyvIxqAjr0mqK9r8sVBl8d1RYdPoxptHmVupAUtDRIWTCJ7hbuvc5adMHXNkQ81cu X-Received: by 10.66.65.142 with SMTP id x14mr13933529pas.14.1401700161253; Mon, 02 Jun 2014 02:09:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.118 with SMTP id f109ls1867617qge.8.gmail; Mon, 02 Jun 2014 02:09:21 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr2329776vck.29.1401700161092; Mon, 02 Jun 2014 02:09:21 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id 3si7585153vcs.47.2014.06.02.02.09.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Jun 2014 02:09:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id jx11so4864045veb.14 for ; Mon, 02 Jun 2014 02:09:21 -0700 (PDT) X-Received: by 10.52.175.69 with SMTP id by5mr24564965vdc.16.1401700161013; Mon, 02 Jun 2014 02:09:21 -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 ib8csp82632vcb; Mon, 2 Jun 2014 02:09:20 -0700 (PDT) X-Received: by 10.68.203.132 with SMTP id kq4mr39253957pbc.12.1401700160161; Mon, 02 Jun 2014 02:09:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tp10si15023760pbc.170.2014.06.02.02.09.19; Mon, 02 Jun 2014 02:09:19 -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 S1753293AbaFBJJJ (ORCPT + 28 others); Mon, 2 Jun 2014 05:09:09 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:45557 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753104AbaFBJJE (ORCPT ); Mon, 2 Jun 2014 05:09:04 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi2so4113677wib.11 for ; Mon, 02 Jun 2014 02:09:02 -0700 (PDT) X-Received: by 10.180.198.178 with SMTP id jd18mr20454735wic.24.1401700142300; Mon, 02 Jun 2014 02:09:02 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-149-12-106.as13285.net. [78.149.12.106]) by mx.google.com with ESMTPSA id lz11sm30854319wic.0.2014.06.02.02.09.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jun 2014 02:09:01 -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 v6 03/12] mmc: mmci: Add enough delay between writes to CMD register. Date: Mon, 2 Jun 2014 10:08:57 +0100 Message-Id: <1401700137-11547-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401699818-11329-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1401699818-11329-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.169 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 Reviewed-by: Linus Walleij --- 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;