From patchwork Wed Sep 3 02:09:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4829781 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 3606A9F2ED for ; Wed, 3 Sep 2014 02:09:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5936F201F4 for ; Wed, 3 Sep 2014 02:09:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 548E9201E4 for ; Wed, 3 Sep 2014 02:09:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048AbaICCJr (ORCPT ); Tue, 2 Sep 2014 22:09:47 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:42401 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752341AbaICCJq (ORCPT ); Tue, 2 Sep 2014 22:09:46 -0400 Received: by mail-pa0-f42.google.com with SMTP id lf10so16172296pab.1 for ; Tue, 02 Sep 2014 19:09:45 -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=4s4IpSjpVNzqUi6BTzDxxKF0zLKnclqh9ZHXckXdwQY=; b=IjFRjuPpgv878PGVTtx3Oi46e33Cg4fY+bOGgVXCPpLlbGD1CxLunv/shZcyTEis0E PkcGqLeIGnrxNEowqK+ysDyQ6k/ZPBpbyNkQ030oSKmfJuq5lb+wkfZBSQhjiNOf4kJn 9XaL1ZF2J05UeicAOHECiwUcZccUSBkvyDc/NQZH5+i2dJkXyYoNs/VoPV/qs9KzCc8J bcycMtOiec8sLhFRbQJUwCH9emZ29eGn6+ChMCcHOgYvipEfvS56dOeaCO2YpVnNXSTe DrJy/RVzn8RtPyeZIIuNnOSKwwowWGfTFoKdrJX15uXD+0gdeySdJRe4AY/l1i0F+5fJ f4qQ== X-Received: by 10.70.100.227 with SMTP id fb3mr23859219pdb.137.1409710185609; Tue, 02 Sep 2014 19:09:45 -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 b15sm7235241pdm.90.2014.09.02.19.09.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 19:09:44 -0700 (PDT) Date: Tue, 02 Sep 2014 19:09:44 -0700 (PDT) Message-ID: <8761h578ux.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile 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, 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 --- v2 -> v3 - blk_size_workaround -> multi_io_quirk 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;