From patchwork Tue Sep 2 02:01:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4822471 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB9D6C0338 for ; Tue, 2 Sep 2014 02:01:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB98D20172 for ; Tue, 2 Sep 2014 02:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 029FE20170 for ; Tue, 2 Sep 2014 02:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751518AbaIBCBu (ORCPT ); Mon, 1 Sep 2014 22:01:50 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:35368 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbaIBCBt (ORCPT ); Mon, 1 Sep 2014 22:01:49 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so7196531pdj.17 for ; Mon, 01 Sep 2014 19:01:49 -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=tgULIT2lGzDtCQ+hONVxT1kiK3fTWJhG0DVPAlLI5mg=; b=jMMblysaIvCntSVC/Ki/e64V53pygJZJ3WFT3jVPFa+/9bhSHsQVWASy3JAkR6XyMA bqZaTUQn+YauTiNPUfTuevQ6VqE6AxNqJUY08LoKSlGX8C411gZC4MVlutiTs6R+WJxw fytwKOjVLFNxH62wouKv6ciSdsItXEQr4EtWBlbx62bKJCa5VAQ8KLxHcsvOCqa55Hwp HWnhLb8AWjPlbvoF3RhkyDfl+ZcCrwET/P4vBfVe2TGrq0E7jjU9fhPkaWKzJ8WaWtct FgN0QScmUdXYupNL27YnNty2ayuY8oPh4rRmBZJwvwcPEMkrQPzUlwNhbfTVBJZfrGLJ EWAw== X-Received: by 10.70.131.70 with SMTP id ok6mr15793058pdb.133.1409623309268; Mon, 01 Sep 2014 19:01:49 -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 ro7sm6994740pab.25.2014.09.01.19.01.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Sep 2014 19:01:48 -0700 (PDT) Date: Mon, 01 Sep 2014 19:01:48 -0700 (PDT) Message-ID: <87iol6kcfp.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 2/7 v2] 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: <87lhq2kcif.wl%kuninori.morimoto.gx@gmail.com> References: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> <87lhq2kcif.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 --- v1 -> v2 - fix typo : .blk_workaround -> .blk_size_workaround 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..a7ab924 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_size_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);