From patchwork Mon Sep 1 09:21:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4817971 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 338949F2ED for ; Mon, 1 Sep 2014 09:21:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5498020155 for ; Mon, 1 Sep 2014 09:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E8A420148 for ; Mon, 1 Sep 2014 09:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbaIAJVb (ORCPT ); Mon, 1 Sep 2014 05:21:31 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:42776 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896AbaIAJV3 (ORCPT ); Mon, 1 Sep 2014 05:21:29 -0400 Received: by mail-pa0-f46.google.com with SMTP id eu11so11862060pac.33 for ; Mon, 01 Sep 2014 02:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=8f/qvvSQ/u30cUNK++GzlMmVx0jccx06hY0q+XitSkA=; b=Net7csE2zCdN0PX0JWdEBi3kQe18vHK57ZpnRRUvggU9Ec/nLPjT91lvcc4Kh6wNyc /E2byLOqeLgr+T2HaU+up7muJrAoBI/c+rXfNpg4HdCoE9phd78H49RS+Y3JLSp065Hx k9l4oB4e9sYHuYlebYIeiqRCg5OK0TOiZja3nEB5dJ3YoqprSxnITGheBqOKi4h8c2So flvrT3DJdNE3noNo3wtNkikcKo0Vyf3fZL3Xl70/lZdOyJR12DoJk1PYfB2GEfYqgPkK rAkJfpQ1reVbEiMRSSTI2LE/Dp/RU8+jG28Z8gFaDS2k5dFVmsXdLT1zWEpeAXdMQmXB mDvA== X-Received: by 10.70.90.76 with SMTP id bu12mr38003303pdb.31.1409563288321; Mon, 01 Sep 2014 02:21:28 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id ci1sm283360pbb.68.2014.09.01.02.21.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Sep 2014 02:21:27 -0700 (PDT) Date: Mon, 01 Sep 2014 02:21:27 -0700 (PDT) Message-ID: <87oauzzofe.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Ulf Hansson , Chris Ball , Simon Cc: Kuninori Morimoto , Linux-SH , linux-mmc In-Reply-To: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> References: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Now, omap_hsmmc can use blk_size_workaround instead of MMC_CAP2_NO_MULTI_READ. let's use it. Signed-off-by: Kuninori Morimoto --- drivers/mmc/host/omap_hsmmc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index ece1634..6d2696b 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -219,6 +219,7 @@ struct omap_hsmmc_host { #define AUTO_CMD23 (1 << 0) /* Auto CMD23 support */ #define HSMMC_SDIO_IRQ_ENABLED (1 << 1) /* SDIO irq enabled */ #define HSMMC_WAKE_IRQ_ENABLED (1 << 2) +#define HSMMC_NO_MULTI_READ (1 << 3) struct omap_hsmmc_next next_data; struct omap_mmc_platform_data *pdata; }; @@ -1829,6 +1830,19 @@ static int omap_hsmmc_disable_fclk(struct mmc_host *mmc) return 0; } +static int *omap_hsmmc_blk_size_workaround(struct mmc_card *card, + struct request *req, int blk_size) +{ + struct omap_hsmmc_host *host = mmc_priv(card->host); + + /* Some controllers can't do multiblock reads due to hw bugs */ + if ((host->flags & HSMMC_NO_MULTI_READ) && + (rq_data_dir(req) == READ)) + return 1; + + return blk_size; +} + static const struct mmc_host_ops omap_hsmmc_ops = { .enable = omap_hsmmc_enable_fclk, .disable = omap_hsmmc_disable_fclk, @@ -1840,6 +1854,7 @@ static const struct mmc_host_ops omap_hsmmc_ops = { .get_ro = omap_hsmmc_get_ro, .init_card = omap_hsmmc_init_card, .enable_sdio_irq = omap_hsmmc_enable_sdio_irq, + .blk_workaround = omap_hsmmc_blk_size_workaround, }; #ifdef CONFIG_DEBUG_FS @@ -2101,7 +2116,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) if (host->pdata->controller_flags & OMAP_HSMMC_BROKEN_MULTIBLOCK_READ) { dev_info(&pdev->dev, "multiblock reads disabled due to 35xx erratum 2.1.1.128; MMC read performance may suffer\n"); - mmc->caps2 |= MMC_CAP2_NO_MULTI_READ; + host->flags |= HSMMC_NO_MULTI_READ; } pm_runtime_enable(host->dev);