From patchwork Wed Oct 10 15:43:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 12150 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AFF5A23F58 for ; Wed, 10 Oct 2012 15:44:29 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5D880A18814 for ; Wed, 10 Oct 2012 15:44:29 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1122011iej.11 for ; Wed, 10 Oct 2012 08:44:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=UaObszNdLhanYhZZLvAZZaszDlHNOGyjqKWG2BPjAU0=; b=Xx/gKQ/N1Fm/1xj2Rxi28T7HcjswBSTW057kx52wcohvkOHkrCcKFawPEr1KJAAAvc ip3CBER6C/0pi8t8VIVWEJKecPcqC1g8Ve/0u/y4X6tRI8mQo7FCVRyJ8cM2HIcKTOly go+fI7RCBx58Z139u52Bcd/k7so0n8GJdB4nTBx/fX+z36WRWZL6NBWHYVYYL8lRbOU6 m/n/Bf4MJkaqP9/P5idOiwqM9QBM8H4AoFVVAKF+LhQK+kvDPooLfGjyhwBySWMT3k3t qA8rltN23SrzBMjGklrobB1KLUQdP/+chmJKzkyiyEKnEgaxWTyYBJ0wPojpTXU1BhLi JS/g== Received: by 10.50.236.72 with SMTP id us8mr5616970igc.70.1349883868834; Wed, 10 Oct 2012 08:44:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp243437igt; Wed, 10 Oct 2012 08:44:27 -0700 (PDT) Received: by 10.14.1.69 with SMTP id 45mr33652496eec.23.1349883866356; Wed, 10 Oct 2012 08:44:26 -0700 (PDT) Received: from eu1sys200aog116.obsmtp.com (eu1sys200aog116.obsmtp.com [207.126.144.141]) by mx.google.com with SMTP id u6si1278469eep.143.2012.10.10.08.44.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 08:44:26 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKUHWXznUL2zfm9MZ09zEKnRQg1TG0u/nv@postini.com; Wed, 10 Oct 2012 15:44:26 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 2289354; Wed, 10 Oct 2012 15:43:27 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 3BE834D; Wed, 10 Oct 2012 11:22:41 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 9B08EA8093; Wed, 10 Oct 2012 17:43:51 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 10 Oct 2012 17:43:57 +0200 From: Ulf Hansson To: , Chris Ball Cc: , Russell King , Linus Walleij , Ulf Hansson , Ulf Hansson Subject: [PATCH 2/2] mmc: mmci: Switching off HWFC for SDIO depends on MCLK Date: Wed, 10 Oct 2012 17:43:45 +0200 Message-ID: <1349883825-22517-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349883825-22517-1-git-send-email-ulf.hansson@stericsson.com> References: <1349883825-22517-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnbeqFbxaou1gX1PdFrqK/U6ZdecKgSrdWh1eKI6ec+MTNYix4dMOXbf6O90BrsPrZsJ1Dg For writes, HWFC shall be switched off when transfer size <= 8 bytes and when MCLK rate is above 50 MHz. For 50MHz and below it shall be switched off when transfer size < 8 bytes. Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 877079e..cd0fbee 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -664,12 +664,14 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) datactrl |= MCI_ST_DPSM_SDIOEN; /* - * The ST Micro variant for SDIO transfer sizes - * less then 8 bytes should have clock H/W flow - * control disabled. + * The ST Micro variant for SDIO small write transfers + * needs to have clock H/W flow control disabled, + * otherwise the transfer will not start. The threshold + * depends on the rate of MCLK. */ - if ((host->size < 8) && - (data->flags & MMC_DATA_WRITE)) + if (data->flags & MMC_DATA_WRITE && + (host->size < 8 || + (host->size <= 8 && host->mclk > 50000000))) clk = host->clk_reg & ~variant->clkreg_enable; else clk = host->clk_reg | variant->clkreg_enable;