From patchwork Tue Sep 2 02:02:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4822511 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 16E7C9F2ED for ; Tue, 2 Sep 2014 02:02:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3EBF220172 for ; Tue, 2 Sep 2014 02:02:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66A3720170 for ; Tue, 2 Sep 2014 02:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751925AbaIBCCe (ORCPT ); Mon, 1 Sep 2014 22:02:34 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:58861 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751786AbaIBCCd (ORCPT ); Mon, 1 Sep 2014 22:02:33 -0400 Received: by mail-pa0-f51.google.com with SMTP id rd3so13566448pab.10 for ; Mon, 01 Sep 2014 19:02:33 -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=YzPZDalgL8tYv3tPyfxsChHa8i6n+3MRzJ80OLQRems=; b=v6Ha76Q4vUIAFzQYNnGrDXcLn+Hsf+7xc9kEfYDVd7kjQ1ON5ckn2eU+WjTw8L2ZOm 1dqwBDFqFPb9T10OKYRQQI1hGBs12WTbXeZzOaYxtlaTYI+H+8zmQNuMcW0Rl7zfPHlt NQvHpKMrGFQ90p5AKtaHdTIoNV1kLhkcBH5Oz45gT3HsbhiyQ6VOmWdh8P8713JovG19 r+z3eMMJcYFsBBXYCB3BteTkkmzjxOnJajIX86IAQoKyi+NUciA1rWcGBs5jjs8Yq97j YMi+F3K2+GKcL8tABiQBYHcyCMmL9Fw1Cb4/4wm1O4KXwV1ZDFGow+n3wbxdZLXSKdiF SnpQ== X-Received: by 10.70.37.134 with SMTP id y6mr43609243pdj.33.1409623352943; Mon, 01 Sep 2014 19:02:32 -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 wi10sm2169853pbc.95.2014.09.01.19.02.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Sep 2014 19:02:32 -0700 (PDT) Date: Mon, 01 Sep 2014 19:02:32 -0700 (PDT) Message-ID: <87fvgakcei.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 4/7 v2] mmc: sh_mobile_sdhi: 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, sh_mobile_sdhi can use blk_size_workaround instead of MMC_CAP2_NO_MULTI_READ. let's use it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - 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..474cd8e 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_blk_size_workaround(struct mmc_card *card, + struct request *req, 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 ((rq_data_dir(req) == 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->blk_size_workaround = sh_mobile_blk_size_workaround; if (p) { mmc_data->flags = p->tmio_flags; mmc_data->ocr_mask = p->tmio_ocr_mask;