From patchwork Wed Apr 17 11:50:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fredrik Soderstedt X-Patchwork-Id: 16163 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 395DC23911 for ; Wed, 17 Apr 2013 11:51:59 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id 14sf2622122vea.9 for ; Wed, 17 Apr 2013 04:51:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=aZcz+2tKceM6P0MdiObuadj5E7m0qhStLgU6g8O/Epg=; b=arWBWjfMb+xuSN6TlpJZ9XC9fLvqfk+ZUCXMTM96kSQum9ZzcfHXkoRVqP5X4xDSIV o82L0lcuYaCJ92MtKe9Gu2HoWe0Ez87EF+dM82cLSQRfKFXFz5VYSsgNR4vHpVhzXXSz p2CS2Ai8tVTlnrRmuBzA0Cp8OL9RO0IKdtPTVulIb5FS7JY2WKnwJlBF0jDo8Jm377ue aahXjZRwxsJ/hPaAyYQnq8/Lps5OFH0kiOOm98/oL2zI2mvj9NGmpAkxaJaodpSDG93c z4aT8h91riCXOIRU2oD+AIXQOoHH4CICa0HNzpU+xJLwu5yHo8oqqsP1HjzvXVDyElGW D2/Q== X-Received: by 10.236.147.79 with SMTP id s55mr3118572yhj.18.1366199484089; Wed, 17 Apr 2013 04:51:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.5 with SMTP id m5ls150730qeq.40.gmail; Wed, 17 Apr 2013 04:51:23 -0700 (PDT) X-Received: by 10.220.245.4 with SMTP id ls4mr4551753vcb.17.1366199483921; Wed, 17 Apr 2013 04:51:23 -0700 (PDT) Received: from mail-vb0-x22e.google.com (mail-vb0-x22e.google.com [2607:f8b0:400c:c02::22e]) by mx.google.com with ESMTPS id j11si3729755vcw.5.2013.04.17.04.51.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Apr 2013 04:51:23 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22e; Received: by mail-vb0-f46.google.com with SMTP id 11so1166477vbe.19 for ; Wed, 17 Apr 2013 04:51:23 -0700 (PDT) X-Received: by 10.220.242.73 with SMTP id lh9mr4495726vcb.49.1366199483713; Wed, 17 Apr 2013 04:51:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp69556veb; Wed, 17 Apr 2013 04:51:22 -0700 (PDT) X-Received: by 10.194.93.68 with SMTP id cs4mr10800817wjb.17.1366199482478; Wed, 17 Apr 2013 04:51:22 -0700 (PDT) Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com [207.126.144.115]) by mx.google.com with SMTP id b4si8760713eef.232.2013.04.17.04.51.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Apr 2013 04:51:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.115 is neither permitted nor denied by best guess record for domain of fredrik.soderstedt@stericsson.com) client-ip=207.126.144.115; Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKUW6MtvnqqI8Ox9Wnoz8wfIm700HwjzTG@postini.com; Wed, 17 Apr 2013 11:51:22 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 057D8147; Wed, 17 Apr 2013 11:43:09 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 90533165E; Wed, 17 Apr 2013 11:51:15 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 4028A24C07D; Wed, 17 Apr 2013 13:51:08 +0200 (CEST) Received: from steludxu4022.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Wed, 17 Apr 2013 13:51:14 +0200 From: Fredrik Soderstedt To: , Chris Ball Cc: Ulf Hansson , Fredrik Soderstedt Subject: [PATCH] mmc: core: Only execute tuning for SDR50 and SDR104 Date: Wed, 17 Apr 2013 13:50:53 +0200 Message-ID: <1366199453-6135-1-git-send-email-fredrik.soderstedt@stericsson.com> X-Mailer: git-send-email 1.8.2.1 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlv/HnCbSQlSZN/6Y7dybRDBoEgzMHsJguQOuQ+SZ5sx7jv389bxv8x//eZ9G0+8T2FLuk4 X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Only execute tuning for sd and sdio devices that are using SDR50 or SDR104. Make sure clock is hold during tuning for sdio devices. Signed-off-by: Fredrik Soderstedt --- drivers/mmc/core/sd.c | 9 +++++++-- drivers/mmc/core/sdio.c | 12 ++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 9e645e1..8373d22 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -646,8 +646,13 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card) if (err) goto out; - /* SPI mode doesn't define CMD19 */ - if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning) { + /* + * SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and + * SDR104 mode SD-cards. Note that tuning is mandatory for SDR104. + */ + if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning && + (card->sd_bus_speed == UHS_SDR50_BUS_SPEED || + card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) { mmc_host_clk_hold(card->host); err = card->host->ops->execute_tuning(card->host, MMC_SEND_TUNING_BLOCK); diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 6889a82..444668c 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -563,10 +563,18 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card) if (err) goto out; - /* Initialize and start re-tuning timer */ - if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning) + /* + * SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and + * SDR104 mode SD-cards. Note that tuning is mandatory for SDR104. + */ + if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning && + ((card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50) || + (card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR104))) { + mmc_host_clk_hold(card->host); err = card->host->ops->execute_tuning(card->host, MMC_SEND_TUNING_BLOCK); + mmc_host_clk_release(card->host); + } out: