From patchwork Tue Sep 9 06:45:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4866471 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 0B0AB9F32E for ; Tue, 9 Sep 2014 06:45:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18B0E20142 for ; Tue, 9 Sep 2014 06:45:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3355F2013D for ; Tue, 9 Sep 2014 06:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754630AbaIIGpr (ORCPT ); Tue, 9 Sep 2014 02:45:47 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:33166 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751974AbaIIGpr (ORCPT ); Tue, 9 Sep 2014 02:45:47 -0400 Received: by mail-pd0-f176.google.com with SMTP id y13so4641146pdi.35 for ; Mon, 08 Sep 2014 23:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:message-id:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=4V7J9GFY7jP4OqsSoeIEZKbuDzYGmHx+qcMZQ4KGZog=; b=hPQbQuuZF7NYvm6ULvlf3uWib3zTFv1HdFTa6LYZOfIkiLfBOnJ84k7b52tA3ucWbM gJVWqB41Kzog/ELdP3w3mfePr2M8kuaYw2ZcVZ0DG3pL5/fVEBI+eYtJcOHBGFCAMdbW BhznDqlZjTuCrF0ZHSNC4DHulHZkAlAEYd8gBfKGg12cPg8wAJrgZ+IG/dBf9PXS1W1h ikRrKgAcj/VBtzpMYl9QxMcvG1HKknfQPYB9dX1rRQc/nNdBSECRD+lDOVGAoET8emO+ Sr2EswzzshYjR1nagHB/hxMm2nOWr6FwrPUujKH4ohJ62x8rv60c987yCKHw89aWF/48 hAVw== X-Received: by 10.70.42.71 with SMTP id m7mr31421738pdl.72.1410245146809; Mon, 08 Sep 2014 23:45:46 -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 rk2sm10595290pbc.1.2014.09.08.23.45.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 08 Sep 2014 23:45:46 -0700 (PDT) Date: Mon, 08 Sep 2014 23:45:46 -0700 (PDT) From: Kuninori Morimoto Message-ID: <87fvg170mg.wl%kuninori.morimoto.gx@gmail.com> Subject: [PATCH 3/6 v4] mmc: use .multi_io_quirk on sh_mobile 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: <87k35d70pz.wl%kuninori.morimoto.gx@gmail.com> References: <87r3zvzohj.wl%kuninori.morimoto.gx@gmail.com> <87k35d70pz.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=-9.3 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, sh_mobile_sdhi can use .multi_io_quirk callback instead of MMC_CAP2_NO_MULTI_READ flags. let's use it. Signed-off-by: Kuninori Morimoto --- v3 -> v4 - no change drivers/mmc/host/sh_mobile_sdhi.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index f2585b6..a2e81a1 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -58,7 +58,6 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_CLK_ACTUAL, .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, - .capabilities2 = MMC_CAP2_NO_MULTI_READ, .dma_rx_offset = 0x2000, }; @@ -139,6 +138,24 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr) return 0; } +static int sh_mobile_sdhi_multi_io_quirk(struct mmc_card *card, + unsigned int direction, int blk_size) +{ + /* + * In Renesas controllers, when performing a + * multiple block read of one or two blocks, + * depending on the timing with which the + * response register is read, the response + * value may not be read properly. + * Use single block read for this HW bug + */ + if ((direction == MMC_DATA_READ) && + blk_size == 2) + return 1; + + return blk_size; +} + static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev) { mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100)); @@ -194,6 +211,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->clk_disable = sh_mobile_sdhi_clk_disable; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; + mmc_data->multi_io_quirk = sh_mobile_sdhi_multi_io_quirk; if (p) { mmc_data->flags = p->tmio_flags; mmc_data->ocr_mask = p->tmio_ocr_mask;