From patchwork Wed Sep 3 02:09:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4829741 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 A09DDC0338 for ; Wed, 3 Sep 2014 02:09:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6FFD201F4 for ; Wed, 3 Sep 2014 02:09:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8B66201E4 for ; Wed, 3 Sep 2014 02:09:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751364AbaICCJV (ORCPT ); Tue, 2 Sep 2014 22:09:21 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:53377 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbaICCJU (ORCPT ); Tue, 2 Sep 2014 22:09:20 -0400 Received: by mail-pa0-f43.google.com with SMTP id et14so16278150pad.2 for ; Tue, 02 Sep 2014 19:09:19 -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:mime-version:to:cc :in-reply-to:references:content-type; bh=xv1i0WF3HICJADjUNmj/xhXi789egOBm6Ht+Nq9L9mM=; b=GzYx+1EjQr4ut6EIuC/1wbz835+Vj6sY5UtGDh6cVdr7GAeEpgbJahP3C+9Em3SchZ DPu41ArBWgni+8oZIljiTA2K3d1rPd3ZAdB/eBcZ0wTCGKXKevgfQe9nSeAVyPKd3CWm WiTZFZZgXqZIH4a7Kl16KA6fWffkRaWFfK1/s2DODUixaCWq+tSkSX1MdonqT727hJKk a3SDT1ZhF5q7yqNiX+rhir/Kk+FJcNXIV7w/t/slUQgGWXL8tyv+ug6UEbKhYNTrPHkL 73DZ0lRvorR/S7+FdPC3lDmQLiX2xQ6vg0ETlhhwrH1r36XwMZqA4kzIo0DK6sG+1YX7 IZIg== X-Received: by 10.66.102.68 with SMTP id fm4mr52624196pab.46.1409710159746; Tue, 02 Sep 2014 19:09:19 -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 ge5sm5224646pbc.81.2014.09.02.19.09.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 19:09:19 -0700 (PDT) Date: Tue, 02 Sep 2014 19:09:19 -0700 (PDT) Message-ID: <878um178vn.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Ulf Hansson , Chris Ball , Simon Cc: Kuninori Morimoto , Linux-SH , linux-mmc In-Reply-To: <87bnqx78xr.wl%kuninori.morimoto.gx@gmail.com> References: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> <87bnqx78xr.wl%kuninori.morimoto.gx@gmail.com> 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.5 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 .multi_io_quirk callback instead of MMC_CAP2_NO_MULTI_READ flags. let's use it. Signed-off-by: Kuninori Morimoto --- v2 -> v3 - blk_size_workaround -> multi_io_quirk 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..7b41f57 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_multi_io_quirk(struct mmc_card *card, + unsigned int direction, int blk_size) +{ + struct omap_hsmmc_host *host = mmc_priv(card->host); + + /* This controller can't do multiblock reads due to hw bugs */ + if ((host->flags & HSMMC_NO_MULTI_READ) && + (direction == MMC_DATA_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, + .multi_io_quirk = omap_hsmmc_multi_io_quirk, }; #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);