linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, Chris Ball <cjb@laptop.org>,
	Simon <horms@verge.net.au>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Linux-SH <linux-sh@vger.kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>
Subject: [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
Date: Wed, 03 Sep 2014 02:09:44 +0000	[thread overview]
Message-ID: <8761h578ux.wl%kuninori.morimoto.gx@gmail.com> (raw)
In-Reply-To: <87bnqx78xr.wl%kuninori.morimoto.gx@gmail.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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 <kuninori.morimoto.gx@renesas.com>
---
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;
-- 
1.7.9.5


  parent reply	other threads:[~2014-09-03  2:09 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  9:20 [PATCH 0/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-01  9:20 ` [PATCH 1/7] mmc: add blk_size_workaround for HW bug Kuninori Morimoto
2014-09-01  9:21 ` [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround Kuninori Morimoto
2014-09-01 10:05   ` Sergei Shtylyov
2014-09-01 23:52     ` Kuninori Morimoto
2014-09-01  9:21 ` [PATCH 3/7] mmc: tmio_mmc: " Kuninori Morimoto
2014-09-01  9:22 ` [PATCH 4/7] mmc: sh_mobile_sdhi: " Kuninori Morimoto
2014-09-01  9:22 ` [PATCH 5/7] ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ Kuninori Morimoto
2014-09-01  9:22 ` [PATCH 6/7] ARM: shmobile: lager: " Kuninori Morimoto
2014-09-01  9:23 ` [PATCH 7/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-02  2:00 ` [PATCH 0/7 v2] " Kuninori Morimoto
2014-09-02  2:01   ` [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug Kuninori Morimoto
2014-09-02  9:09     ` Ulf Hansson
2014-09-03  0:44       ` Kuninori Morimoto
2014-09-02  2:01   ` [PATCH 2/7 v2] mmc: omap_hsmmc: use blk_size_workaround Kuninori Morimoto
2014-09-02  2:02   ` [PATCH 3/7 v2] mmc: tmio_mmc: " Kuninori Morimoto
2014-09-02  2:02   ` [PATCH 4/7 v2] mmc: sh_mobile_sdhi: " Kuninori Morimoto
2014-09-02  2:02   ` [PATCH 5/7 v2] ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ Kuninori Morimoto
2014-09-02  2:03   ` [PATCH 6/7 v2] ARM: shmobile: lager: " Kuninori Morimoto
2014-09-02  2:03   ` [PATCH 7/7 v2] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-03  2:08 ` [PATCH 0/7 v3] " Kuninori Morimoto
2014-09-03  2:08   ` [PATCH 1/7 v3] mmc: add .multi_io_quirk callback for multi I/O HW bug Kuninori Morimoto
2014-09-08  9:08     ` Ulf Hansson
2014-09-03  2:09   ` [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc Kuninori Morimoto
2014-09-08  9:10     ` Ulf Hansson
2014-09-09  0:09       ` Kuninori Morimoto
2014-09-09  6:00         ` Ulf Hansson
2014-09-09  6:07           ` Kuninori Morimoto
2014-09-09  6:36             ` Ulf Hansson
2014-09-09  6:39               ` Kuninori Morimoto
2014-09-03  2:09   ` [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc Kuninori Morimoto
2014-09-08 10:43     ` Ulf Hansson
2014-09-08 11:11       ` Lee Jones
2014-09-08 11:45         ` Ulf Hansson
2014-09-09  0:14       ` Kuninori Morimoto
2014-09-09  6:32         ` Ulf Hansson
2014-09-09  6:33           ` Kuninori Morimoto
2014-09-03  2:09   ` Kuninori Morimoto [this message]
2014-09-08 10:28     ` [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile Ulf Hansson
2014-09-08 10:53       ` Ulf Hansson
2014-09-03  2:10   ` [PATCH 5/7 v3] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch Kuninori Morimoto
2014-09-03  2:10   ` [PATCH 6/7 v3] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager Kuninori Morimoto
2014-09-03  2:10   ` [PATCH 7/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-09  2:43   ` [PATCH 0/7 " Simon Horman
2014-09-09  2:45     ` Kuninori Morimoto
2014-09-09  3:56       ` Simon Horman
2014-09-09  6:43 ` [PATCH 0/6 v4] " Kuninori Morimoto
2014-09-09  6:44   ` [PATCH 1/6 v4] mmc: use .multi_io_quirk on omap_hsmmc Kuninori Morimoto
2014-09-09  6:45   ` [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc Kuninori Morimoto
2014-09-09  7:00     ` Ulf Hansson
2014-09-09  7:04     ` Kuninori Morimoto
2014-09-09  7:23       ` Lee Jones
2014-09-09  6:45   ` [PATCH 3/6 v4] mmc: use .multi_io_quirk on sh_mobile Kuninori Morimoto
2014-09-09  6:46   ` [PATCH 4/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch Kuninori Morimoto
2014-09-09  8:20     ` Simon Horman
2014-09-09  6:46   ` [PATCH 5/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager Kuninori Morimoto
2014-09-09  8:21     ` Simon Horman
2014-09-09  6:46   ` [PATCH 6/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-09 12:19   ` [PATCH 0/6 " Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761h578ux.wl%kuninori.morimoto.gx@gmail.com \
    --to=kuninori.morimoto.gx@gmail.com \
    --cc=cjb@laptop.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).