From patchwork Wed Oct 10 16:03:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 12152 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 64D8623F58 for ; Wed, 10 Oct 2012 16:03:46 +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 E1F56A1881A for ; Wed, 10 Oct 2012 16:03:45 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1165324iej.11 for ; Wed, 10 Oct 2012 09:03:45 -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=2lcrm/ZvGyouEllrnc3o8BewZNYUDdMRlz4gGJRnQ2g=; b=ivM+WmTq+iGPjqXNR4RmzG7t3tyWSEdn4FkKDSbY6GxtJJH2aYg4KmKlLdlUc64w8M a1ATmMBY1FlAKGLqNuWu1xjDC3+73gwh9p+nd1c1l69PfcuID+PL+EC6L85GVFpAj+lC 1BrltVWh7pJu9H8fSZLql++tFOSLc+DDfG863TKOqKIMEku/KxOKwpYpB84Bm6vMVyKA KBHcQCU9bkmEy21C0eNr+lWpFHqgzLrYL1IZdXvJkeL4QSWEBHI4EitgcpZlN3COW8Zm 1BJl2xHiHRFkvWIbLbVtXnK8fw8p5yFOrzcrTjF9xGKZSooy++e59/kXRCTtmM6KG/7v AYCw== Received: by 10.50.77.138 with SMTP id s10mr5743034igw.70.1349885025392; Wed, 10 Oct 2012 09:03:45 -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 n20csp246085igt; Wed, 10 Oct 2012 09:03:44 -0700 (PDT) Received: by 10.14.193.136 with SMTP id k8mr23182412een.30.1349885023602; Wed, 10 Oct 2012 09:03:43 -0700 (PDT) Received: from eu1sys200aog112.obsmtp.com (eu1sys200aog112.obsmtp.com [207.126.144.133]) by mx.google.com with SMTP id v4si1384698eel.44.2012.10.10.09.03.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 09:03:43 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.133 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-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob112.postini.com ([207.126.147.11]) with SMTP ID DSNKUHWcU3ScyfIi8hVRR6PEUw2LiwrmbXxi@postini.com; Wed, 10 Oct 2012 16:03:43 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 AF430A7; Wed, 10 Oct 2012 15:55:12 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7312EE2F; Wed, 10 Oct 2012 16:03:26 +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 relay2.stm.gmessaging.net (Postfix) with ESMTPS id 2F417A8093; Wed, 10 Oct 2012 18:03:19 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 10 Oct 2012 18:03:25 +0200 From: Ulf Hansson To: , Chris Ball Cc: , Russell King , Linus Walleij , Ulf Hansson Subject: [RESEND PATCH 2/2] mmc: mmci: Switching off HWFC for SDIO depends on MCLK Date: Wed, 10 Oct 2012 18:03:20 +0200 Message-ID: <1349885000-22887-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1349885000-22887-1-git-send-email-ulf.hansson@stericsson.com> References: <1349885000-22887-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQk1X1z7yOzyCsc6w7/5iNflNRHJpNmooR9NhByKGiuwsPz6J5NfzfK9bMPvFyRK4+TNbZJm From: Ulf Hansson 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;