All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-01  9:20 ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:20 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These patches remove MMC_CAP2_NO_MULTI_READ from mmc.
This flag should be implemented under each driver,
not mmc block framework.

Simon
5) and 6) are for sh-arm patches.
Can you check it ?

Kuninori Morimoto (7):
      1) mmc: add blk_size_workaround for HW bug
      2) mmc: omap_hsmmc: use blk_size_workaround
      3) mmc: tmio_mmc: use blk_size_workaround
      4) mmc: sh_mobile_sdhi: use blk_size_workaround
      5) ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
      6) ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
      7) mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |    8 ++++----
 drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    4 ++++
 include/linux/mmc/host.h               |    5 ++++-
 8 files changed, 60 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-01  9:20 ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:20 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These patches remove MMC_CAP2_NO_MULTI_READ from mmc.
This flag should be implemented under each driver,
not mmc block framework.

Simon
5) and 6) are for sh-arm patches.
Can you check it ?

Kuninori Morimoto (7):
      1) mmc: add blk_size_workaround for HW bug
      2) mmc: omap_hsmmc: use blk_size_workaround
      3) mmc: tmio_mmc: use blk_size_workaround
      4) mmc: sh_mobile_sdhi: use blk_size_workaround
      5) ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
      6) ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
      7) mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |    8 ++++----
 drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    4 ++++
 include/linux/mmc/host.h               |    5 ++++-
 8 files changed, 60 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 1/7] mmc: add blk_size_workaround for HW bug
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:20   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:20 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
for HW bug workaround, but it should be implemented
under driver, not framework.
This patch is prepare for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/card/block.c |    5 +++++
 include/linux/mmc/host.h |    4 ++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..e946067 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
 		    rq_data_dir(req) = READ)
 			brq->data.blocks = 1;
+
+		/* Some controllers needs workaround */
+		if (card->host->ops->blk_size_workaround)
+			brq->data.blocks = card->host->ops->blk_size_workaround(
+				card, req, brq->data.blocks);
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4cbf614..95bd903 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -139,6 +139,10 @@ struct mmc_host_ops {
 	int	(*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
 	void	(*hw_reset)(struct mmc_host *host);
 	void	(*card_event)(struct mmc_host *host);
+
+	/* optional callback for mmc block HW bug workaround */
+	int	(*blk_size_workaround)(struct mmc_card *card,
+				       struct request *req, int blk_size);
 };
 
 struct mmc_card;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 1/7] mmc: add blk_size_workaround for HW bug
@ 2014-09-01  9:20   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:20 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
for HW bug workaround, but it should be implemented
under driver, not framework.
This patch is prepare for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/card/block.c |    5 +++++
 include/linux/mmc/host.h |    4 ++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..e946067 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
 		    rq_data_dir(req) == READ)
 			brq->data.blocks = 1;
+
+		/* Some controllers needs workaround */
+		if (card->host->ops->blk_size_workaround)
+			brq->data.blocks = card->host->ops->blk_size_workaround(
+				card, req, brq->data.blocks);
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4cbf614..95bd903 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -139,6 +139,10 @@ struct mmc_host_ops {
 	int	(*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
 	void	(*hw_reset)(struct mmc_host *host);
 	void	(*card_event)(struct mmc_host *host);
+
+	/* optional callback for mmc block HW bug workaround */
+	int	(*blk_size_workaround)(struct mmc_card *card,
+				       struct request *req, int blk_size);
 };
 
 struct mmc_card;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:21   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:21 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, omap_hsmmc can use blk_size_workaround instead of
MMC_CAP2_NO_MULTI_READ. let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 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..6d2696b 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_blk_size_workaround(struct mmc_card *card,
+					   struct request *req, int blk_size)
+{
+	struct omap_hsmmc_host *host = mmc_priv(card->host);
+
+	/* Some controllers can't do multiblock reads due to hw bugs */
+	if ((host->flags & HSMMC_NO_MULTI_READ) &&
+	    (rq_data_dir(req) = 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,
+	.blk_workaround = omap_hsmmc_blk_size_workaround,
 };
 
 #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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround
@ 2014-09-01  9:21   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:21 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, omap_hsmmc can use blk_size_workaround instead of
MMC_CAP2_NO_MULTI_READ. let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 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..6d2696b 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_blk_size_workaround(struct mmc_card *card,
+					   struct request *req, int blk_size)
+{
+	struct omap_hsmmc_host *host = mmc_priv(card->host);
+
+	/* Some controllers can't do multiblock reads due to hw bugs */
+	if ((host->flags & HSMMC_NO_MULTI_READ) &&
+	    (rq_data_dir(req) == 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,
+	.blk_workaround = omap_hsmmc_blk_size_workaround,
 };
 
 #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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/7] mmc: tmio_mmc: use blk_size_workaround
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:21   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:21 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc can use blk_size_workaround.
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..f9afa27 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_blk_size_workaround(struct mmc_card *card,
+				    struct request *req, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->blk_size_workaround)
+		return pdata->blk_size_workaround(card, req, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.blk_size_workaround = tmio_blk_size_workaround,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..0e0bd6a 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,10 +1,12 @@
 #ifndef MFD_TMIO_H
 #define MFD_TMIO_H
 
+#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +144,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*blk_size_workaround)(struct mmc_card *card,
+				   struct request *req, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/7] mmc: tmio_mmc: use blk_size_workaround
@ 2014-09-01  9:21   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:21 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc can use blk_size_workaround.
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..f9afa27 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_blk_size_workaround(struct mmc_card *card,
+				    struct request *req, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->blk_size_workaround)
+		return pdata->blk_size_workaround(card, req, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.blk_size_workaround = tmio_blk_size_workaround,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..0e0bd6a 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,10 +1,12 @@
 #ifndef MFD_TMIO_H
 #define MFD_TMIO_H
 
+#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +144,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*blk_size_workaround)(struct mmc_card *card,
+				   struct request *req, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/7] mmc: sh_mobile_sdhi: use blk_size_workaround
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:22   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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 <kuninori.morimoto.gx@renesas.com>
---
 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 d5d4937..5c44e77 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,
 };
 
@@ -136,6 +135,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));
@@ -191,6 +208,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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/7] mmc: sh_mobile_sdhi: use blk_size_workaround
@ 2014-09-01  9:22   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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 <kuninori.morimoto.gx@renesas.com>
---
 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 d5d4937..5c44e77 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,
 };
 
@@ -136,6 +135,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));
@@ -191,6 +208,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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/7] ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:22   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/7] ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
@ 2014-09-01  9:22   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/7] ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:22   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/7] ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
@ 2014-09-01  9:22   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:22 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 7/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-01  9:23   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:23 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses blk_size_workaround
for block size HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e946067..7b09ac3 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) = READ)
-			brq->data.blocks = 1;
-
 		/* Some controllers needs workaround */
 		if (card->host->ops->blk_size_workaround)
 			brq->data.blocks = card->host->ops->blk_size_workaround(
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 95bd903..70d2cfc 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -269,7 +269,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 7/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-01  9:23   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01  9:23 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses blk_size_workaround
for block size HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e946067..7b09ac3 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) == READ)
-			brq->data.blocks = 1;
-
 		/* Some controllers needs workaround */
 		if (card->host->ops->blk_size_workaround)
 			brq->data.blocks = card->host->ops->blk_size_workaround(
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 95bd903..70d2cfc 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -269,7 +269,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround
  2014-09-01  9:21   ` Kuninori Morimoto
@ 2014-09-01 10:05     ` Sergei Shtylyov
  -1 siblings, 0 replies; 118+ messages in thread
From: Sergei Shtylyov @ 2014-09-01 10:05 UTC (permalink / raw)
  To: Kuninori Morimoto, Ulf Hansson, Chris Ball, Simon
  Cc: Kuninori Morimoto, Linux-SH, linux-mmc

Hello.

On 9/1/2014 1:21 PM, Kuninori Morimoto wrote:

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

> Now, omap_hsmmc can use blk_size_workaround instead of
> MMC_CAP2_NO_MULTI_READ. let's use it.

> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>   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..6d2696b 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
[...]
> @@ -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,
> +	.blk_workaround = omap_hsmmc_blk_size_workaround,

    Not '.blk_size_workaround'?

[...]

WBR, Sergei


^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround
@ 2014-09-01 10:05     ` Sergei Shtylyov
  0 siblings, 0 replies; 118+ messages in thread
From: Sergei Shtylyov @ 2014-09-01 10:05 UTC (permalink / raw)
  To: Kuninori Morimoto, Ulf Hansson, Chris Ball, Simon
  Cc: Kuninori Morimoto, Linux-SH, linux-mmc

Hello.

On 9/1/2014 1:21 PM, Kuninori Morimoto wrote:

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

> Now, omap_hsmmc can use blk_size_workaround instead of
> MMC_CAP2_NO_MULTI_READ. let's use it.

> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>   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..6d2696b 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
[...]
> @@ -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,
> +	.blk_workaround = omap_hsmmc_blk_size_workaround,

    Not '.blk_size_workaround'?

[...]

WBR, Sergei


^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround
  2014-09-01 10:05     ` Sergei Shtylyov
@ 2014-09-01 23:52       ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01 23:52 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Ulf Hansson, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Sergei

> > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> > index ece1634..6d2696b 100644
> > --- a/drivers/mmc/host/omap_hsmmc.c
> > +++ b/drivers/mmc/host/omap_hsmmc.c
> [...]
> > @@ -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,
> > +	.blk_workaround = omap_hsmmc_blk_size_workaround,
> 
>     Not '.blk_size_workaround'?

Ohh my..
I noticed and fixed it in my tree,
but it seems sent old version.
Thank you for pointing it.
will fix in v2

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround
@ 2014-09-01 23:52       ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-01 23:52 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Ulf Hansson, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Sergei

> > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> > index ece1634..6d2696b 100644
> > --- a/drivers/mmc/host/omap_hsmmc.c
> > +++ b/drivers/mmc/host/omap_hsmmc.c
> [...]
> > @@ -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,
> > +	.blk_workaround = omap_hsmmc_blk_size_workaround,
> 
>     Not '.blk_size_workaround'?

Ohh my..
I noticed and fixed it in my tree,
but it seems sent old version.
Thank you for pointing it.
will fix in v2

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/7 v2] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-02  2:00   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:00 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These are v2 patches for removing MMC_CAP2_NO_MULTI_READ from mmc.
Mainly, 0002 was updated in v2

Simon
5) and 6) are for sh-arm patches.
Can you check it ?

Kuninori Morimoto (7):
      1) mmc: add blk_size_workaround for HW bug
      2) mmc: omap_hsmmc: use blk_size_workaround
      3) mmc: tmio_mmc: use blk_size_workaround
      4) mmc: sh_mobile_sdhi: use blk_size_workaround
      5) ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
      6) ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
      7) mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |    8 ++++----
 drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    4 ++++
 include/linux/mmc/host.h               |    5 ++++-
 8 files changed, 60 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/7 v2] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-02  2:00   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:00 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These are v2 patches for removing MMC_CAP2_NO_MULTI_READ from mmc.
Mainly, 0002 was updated in v2

Simon
5) and 6) are for sh-arm patches.
Can you check it ?

Kuninori Morimoto (7):
      1) mmc: add blk_size_workaround for HW bug
      2) mmc: omap_hsmmc: use blk_size_workaround
      3) mmc: tmio_mmc: use blk_size_workaround
      4) mmc: sh_mobile_sdhi: use blk_size_workaround
      5) ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
      6) ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
      7) mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |    8 ++++----
 drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    4 ++++
 include/linux/mmc/host.h               |    5 ++++-
 8 files changed, 60 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:01     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:01 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
for HW bug workaround, but it should be implemented
under driver, not framework.
This patch is prepare for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 drivers/mmc/card/block.c |    5 +++++
 include/linux/mmc/host.h |    4 ++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..e946067 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
 		    rq_data_dir(req) = READ)
 			brq->data.blocks = 1;
+
+		/* Some controllers needs workaround */
+		if (card->host->ops->blk_size_workaround)
+			brq->data.blocks = card->host->ops->blk_size_workaround(
+				card, req, brq->data.blocks);
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4cbf614..95bd903 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -139,6 +139,10 @@ struct mmc_host_ops {
 	int	(*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
 	void	(*hw_reset)(struct mmc_host *host);
 	void	(*card_event)(struct mmc_host *host);
+
+	/* optional callback for mmc block HW bug workaround */
+	int	(*blk_size_workaround)(struct mmc_card *card,
+				       struct request *req, int blk_size);
 };
 
 struct mmc_card;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug
@ 2014-09-02  2:01     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:01 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
for HW bug workaround, but it should be implemented
under driver, not framework.
This patch is prepare for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 drivers/mmc/card/block.c |    5 +++++
 include/linux/mmc/host.h |    4 ++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..e946067 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
 		    rq_data_dir(req) == READ)
 			brq->data.blocks = 1;
+
+		/* Some controllers needs workaround */
+		if (card->host->ops->blk_size_workaround)
+			brq->data.blocks = card->host->ops->blk_size_workaround(
+				card, req, brq->data.blocks);
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4cbf614..95bd903 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -139,6 +139,10 @@ struct mmc_host_ops {
 	int	(*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
 	void	(*hw_reset)(struct mmc_host *host);
 	void	(*card_event)(struct mmc_host *host);
+
+	/* optional callback for mmc block HW bug workaround */
+	int	(*blk_size_workaround)(struct mmc_card *card,
+				       struct request *req, int blk_size);
 };
 
 struct mmc_card;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/7 v2] mmc: omap_hsmmc: use blk_size_workaround
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:01     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:01 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, omap_hsmmc can use blk_size_workaround instead of
MMC_CAP2_NO_MULTI_READ. let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- fix typo : .blk_workaround -> .blk_size_workaround

 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..a7ab924 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_blk_size_workaround(struct mmc_card *card,
+					   struct request *req, int blk_size)
+{
+	struct omap_hsmmc_host *host = mmc_priv(card->host);
+
+	/* Some controllers can't do multiblock reads due to hw bugs */
+	if ((host->flags & HSMMC_NO_MULTI_READ) &&
+	    (rq_data_dir(req) = 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,
+	.blk_size_workaround = omap_hsmmc_blk_size_workaround,
 };
 
 #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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/7 v2] mmc: omap_hsmmc: use blk_size_workaround
@ 2014-09-02  2:01     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:01 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, omap_hsmmc can use blk_size_workaround instead of
MMC_CAP2_NO_MULTI_READ. let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- fix typo : .blk_workaround -> .blk_size_workaround

 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..a7ab924 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_blk_size_workaround(struct mmc_card *card,
+					   struct request *req, int blk_size)
+{
+	struct omap_hsmmc_host *host = mmc_priv(card->host);
+
+	/* Some controllers can't do multiblock reads due to hw bugs */
+	if ((host->flags & HSMMC_NO_MULTI_READ) &&
+	    (rq_data_dir(req) == 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,
+	.blk_size_workaround = omap_hsmmc_blk_size_workaround,
 };
 
 #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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/7 v2] mmc: tmio_mmc: use blk_size_workaround
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:02     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:02 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc can use blk_size_workaround.
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..f9afa27 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_blk_size_workaround(struct mmc_card *card,
+				    struct request *req, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->blk_size_workaround)
+		return pdata->blk_size_workaround(card, req, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.blk_size_workaround = tmio_blk_size_workaround,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..0e0bd6a 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,10 +1,12 @@
 #ifndef MFD_TMIO_H
 #define MFD_TMIO_H
 
+#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +144,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*blk_size_workaround)(struct mmc_card *card,
+				   struct request *req, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/7 v2] mmc: tmio_mmc: use blk_size_workaround
@ 2014-09-02  2:02     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:02 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc can use blk_size_workaround.
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..f9afa27 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_blk_size_workaround(struct mmc_card *card,
+				    struct request *req, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->blk_size_workaround)
+		return pdata->blk_size_workaround(card, req, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.blk_size_workaround = tmio_blk_size_workaround,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..0e0bd6a 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,10 +1,12 @@
 #ifndef MFD_TMIO_H
 #define MFD_TMIO_H
 
+#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +144,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*blk_size_workaround)(struct mmc_card *card,
+				   struct request *req, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/7 v2] mmc: sh_mobile_sdhi: use blk_size_workaround
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:02     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:02 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/7 v2] mmc: sh_mobile_sdhi: use blk_size_workaround
@ 2014-09-02  2:02     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:02 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/7 v2] ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:02     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:02 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/7 v2] ARM: shmobile: koelsch: remove MMC_CAP2_NO_MULTI_READ
@ 2014-09-02  2:02     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:02 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/7 v2] ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:03     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:03 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/7 v2] ARM: shmobile: lager: remove MMC_CAP2_NO_MULTI_READ
@ 2014-09-02  2:03     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:03 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 7/7 v2] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-02  2:00   ` Kuninori Morimoto
@ 2014-09-02  2:03     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:03 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses blk_size_workaround
for block size HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e946067..7b09ac3 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) = READ)
-			brq->data.blocks = 1;
-
 		/* Some controllers needs workaround */
 		if (card->host->ops->blk_size_workaround)
 			brq->data.blocks = card->host->ops->blk_size_workaround(
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 95bd903..70d2cfc 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -269,7 +269,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 7/7 v2] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-02  2:03     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-02  2:03 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses blk_size_workaround
for block size HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

- no change

 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index e946067..7b09ac3 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) == READ)
-			brq->data.blocks = 1;
-
 		/* Some controllers needs workaround */
 		if (card->host->ops->blk_size_workaround)
 			brq->data.blocks = card->host->ops->blk_size_workaround(
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 95bd903..70d2cfc 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -269,7 +269,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* Re: [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug
  2014-09-02  2:01     ` Kuninori Morimoto
@ 2014-09-02  9:09       ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-02  9:09 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 2 September 2014 04:01, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
> for HW bug workaround, but it should be implemented
> under driver, not framework.
> This patch is prepare for it

I like the idea of this patchset!

Still, historically, we have been using MMC_CAP* to solve these kind
issues. Therefore I think the commit message deserves a better
explanation to why we invent a new host ops function pointer for this
particular case.

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
>
> - no change
>
>  drivers/mmc/card/block.c |    5 +++++
>  include/linux/mmc/host.h |    4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index ede41f0..e946067 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>                 if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
>                     rq_data_dir(req) = READ)
>                         brq->data.blocks = 1;
> +
> +               /* Some controllers needs workaround */

Suggest to rephrase the comment to:
"Some controllers have HW issues while operating in multiple I/O mode."

> +               if (card->host->ops->blk_size_workaround)

Do you mind renaming the new callback to "multi_io_quirk"? I think it
better describes what it's intended for.

> +                       brq->data.blocks = card->host->ops->blk_size_workaround(
> +                               card, req, brq->data.blocks);

We shouldn't pass "req" as an argument, since that is a blkdev
specific struct. It's better to pass MMC_DATA_WRITE|READ as an
unsigned int.

>         }
>
>         if (brq->data.blocks > 1 || do_rel_wr) {
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 4cbf614..95bd903 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -139,6 +139,10 @@ struct mmc_host_ops {
>         int     (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
>         void    (*hw_reset)(struct mmc_host *host);
>         void    (*card_event)(struct mmc_host *host);
> +
> +       /* optional callback for mmc block HW bug workaround */

Please update the comment to something like below:

"Optional callback to support controllers with HW issues for multiple I/O.
Returns the number of supported blocks for the request."

> +       int     (*blk_size_workaround)(struct mmc_card *card,
> +                                      struct request *req, int blk_size);
>  };
>
>  struct mmc_card;
> --
> 1.7.9.5
>

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug
@ 2014-09-02  9:09       ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-02  9:09 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 2 September 2014 04:01, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
> for HW bug workaround, but it should be implemented
> under driver, not framework.
> This patch is prepare for it

I like the idea of this patchset!

Still, historically, we have been using MMC_CAP* to solve these kind
issues. Therefore I think the commit message deserves a better
explanation to why we invent a new host ops function pointer for this
particular case.

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
>
> - no change
>
>  drivers/mmc/card/block.c |    5 +++++
>  include/linux/mmc/host.h |    4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index ede41f0..e946067 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1402,6 +1402,11 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>                 if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
>                     rq_data_dir(req) == READ)
>                         brq->data.blocks = 1;
> +
> +               /* Some controllers needs workaround */

Suggest to rephrase the comment to:
"Some controllers have HW issues while operating in multiple I/O mode."

> +               if (card->host->ops->blk_size_workaround)

Do you mind renaming the new callback to "multi_io_quirk"? I think it
better describes what it's intended for.

> +                       brq->data.blocks = card->host->ops->blk_size_workaround(
> +                               card, req, brq->data.blocks);

We shouldn't pass "req" as an argument, since that is a blkdev
specific struct. It's better to pass MMC_DATA_WRITE|READ as an
unsigned int.

>         }
>
>         if (brq->data.blocks > 1 || do_rel_wr) {
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 4cbf614..95bd903 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -139,6 +139,10 @@ struct mmc_host_ops {
>         int     (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
>         void    (*hw_reset)(struct mmc_host *host);
>         void    (*card_event)(struct mmc_host *host);
> +
> +       /* optional callback for mmc block HW bug workaround */

Please update the comment to something like below:

"Optional callback to support controllers with HW issues for multiple I/O.
Returns the number of supported blocks for the request."

> +       int     (*blk_size_workaround)(struct mmc_card *card,
> +                                      struct request *req, int blk_size);
>  };
>
>  struct mmc_card;
> --
> 1.7.9.5
>

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug
  2014-09-02  9:09       ` Ulf Hansson
@ 2014-09-03  0:44         ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  0:44 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
> > for HW bug workaround, but it should be implemented
> > under driver, not framework.
> > This patch is prepare for it
> 
> I like the idea of this patchset!
> 
> Still, historically, we have been using MMC_CAP* to solve these kind
> issues. Therefore I think the commit message deserves a better
> explanation to why we invent a new host ops function pointer for this
> particular case.

Thank you for your feedback.
(Especially "English comment/naming" feedback is very useful for me :)
I send v3 patchset soon

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug
@ 2014-09-03  0:44         ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  0:44 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > Current mmc block.c has MMC_CAP2_NO_MULTI_READ flag
> > for HW bug workaround, but it should be implemented
> > under driver, not framework.
> > This patch is prepare for it
> 
> I like the idea of this patchset!
> 
> Still, historically, we have been using MMC_CAP* to solve these kind
> issues. Therefore I think the commit message deserves a better
> explanation to why we invent a new host ops function pointer for this
> particular case.

Thank you for your feedback.
(Especially "English comment/naming" feedback is very useful for me :)
I send v3 patchset soon

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-03  2:08   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:08 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These are v3 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.

Simon
5) and 6) are for sh-arm patches.
Can you check it ?

Kuninori Morimoto (7):
      mmc: add .multi_io_quirk callback for multi I/O HW bug
      mmc: use .multi_io_quirk on omap_hsmmc
      mmc: use .multi_io_quirk on tmio_mmc
      mmc: use .multi_io_quirk on sh_mobile
      ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
      ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
      mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |   13 +++++++++----
 drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    4 ++++
 include/linux/mmc/host.h               |    8 +++++++-
 8 files changed, 68 insertions(+), 12 deletions(-)

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-03  2:08   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:08 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These are v3 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.

Simon
5) and 6) are for sh-arm patches.
Can you check it ?

Kuninori Morimoto (7):
      mmc: add .multi_io_quirk callback for multi I/O HW bug
      mmc: use .multi_io_quirk on omap_hsmmc
      mmc: use .multi_io_quirk on tmio_mmc
      mmc: use .multi_io_quirk on sh_mobile
      ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
      ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
      mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |   13 +++++++++----
 drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    4 ++++
 include/linux/mmc/host.h               |    8 +++++++-
 8 files changed, 68 insertions(+), 12 deletions(-)

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 1/7 v3] mmc: add .multi_io_quirk callback for multi I/O HW bug
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:08     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:08 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Historically, we have been using MMC_CAP* to solve
some issues, and current mmc block.c has
MMC_CAP2_NO_MULTI_READ flag for multi I/O HW bug workaround.
But it should be implemented under driver, not framework.
This patch is prepare for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - blk_size_workaround -> multi_io_quirk
 - fixup comment/explain
 - use MMC_DATA_READ/WRITE

 drivers/mmc/card/block.c |   10 ++++++++++
 include/linux/mmc/host.h |    7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..adab903 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1402,6 +1402,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
 		    rq_data_dir(req) = READ)
 			brq->data.blocks = 1;
+
+		/*
+		 * Some controllers have HW issues while operating
+		 * in multiple I/O mode
+		 */
+		if (card->host->ops->multi_io_quirk)
+			brq->data.blocks = card->host->ops->multi_io_quirk(card,
+						(rq_data_dir(req) = READ) ?
+						MMC_DATA_READ : MMC_DATA_WRITE,
+						brq->data.blocks);
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4cbf614..bfcf673 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -139,6 +139,13 @@ struct mmc_host_ops {
 	int	(*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
 	void	(*hw_reset)(struct mmc_host *host);
 	void	(*card_event)(struct mmc_host *host);
+
+	/*
+	 * Optional callback to support controllers with HW issues for multiple I/O.
+	 * Returns the number of supported blocks for the request
+	 */
+	int	(*multi_io_quirk)(struct mmc_card *card,
+				  unsigned int direction, int blk_size);
 };
 
 struct mmc_card;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 1/7 v3] mmc: add .multi_io_quirk callback for multi I/O HW bug
@ 2014-09-03  2:08     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:08 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Historically, we have been using MMC_CAP* to solve
some issues, and current mmc block.c has
MMC_CAP2_NO_MULTI_READ flag for multi I/O HW bug workaround.
But it should be implemented under driver, not framework.
This patch is prepare for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - blk_size_workaround -> multi_io_quirk
 - fixup comment/explain
 - use MMC_DATA_READ/WRITE

 drivers/mmc/card/block.c |   10 ++++++++++
 include/linux/mmc/host.h |    7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..adab903 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1402,6 +1402,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
 		    rq_data_dir(req) == READ)
 			brq->data.blocks = 1;
+
+		/*
+		 * Some controllers have HW issues while operating
+		 * in multiple I/O mode
+		 */
+		if (card->host->ops->multi_io_quirk)
+			brq->data.blocks = card->host->ops->multi_io_quirk(card,
+						(rq_data_dir(req) == READ) ?
+						MMC_DATA_READ : MMC_DATA_WRITE,
+						brq->data.blocks);
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4cbf614..bfcf673 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -139,6 +139,13 @@ struct mmc_host_ops {
 	int	(*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
 	void	(*hw_reset)(struct mmc_host *host);
 	void	(*card_event)(struct mmc_host *host);
+
+	/*
+	 * Optional callback to support controllers with HW issues for multiple I/O.
+	 * Returns the number of supported blocks for the request
+	 */
+	int	(*multi_io_quirk)(struct mmc_card *card,
+				  unsigned int direction, int blk_size);
 };
 
 struct mmc_card;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:09     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:09 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-03  2:09     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:09 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:09     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:09 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..ff5ff0f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_multi_io_quirk(struct mmc_card *card,
+			       unsigned int direction, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->multi_io_quirk)
+		return pdata->multi_io_quirk(card, direction, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.multi_io_quirk	= tmio_multi_io_quirk,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..dec750e 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,10 +1,12 @@
 #ifndef MFD_TMIO_H
 #define MFD_TMIO_H
 
+#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +144,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*multi_io_quirk)(struct mmc_card *card,
+			      unsigned int direction, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-03  2:09     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:09 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    4 ++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..ff5ff0f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_multi_io_quirk(struct mmc_card *card,
+			       unsigned int direction, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->multi_io_quirk)
+		return pdata->multi_io_quirk(card, direction, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.multi_io_quirk	= tmio_multi_io_quirk,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..dec750e 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -1,10 +1,12 @@
 #ifndef MFD_TMIO_H
 #define MFD_TMIO_H
 
+#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +144,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*multi_io_quirk)(struct mmc_card *card,
+			      unsigned int direction, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:09     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:09 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
@ 2014-09-03  2:09     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:09 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/7 v3] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:10     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:10 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/7 v3] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
@ 2014-09-03  2:10     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:10 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/7 v3] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:10     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:10 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/7 v3] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
@ 2014-09-03  2:10     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:10 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 7/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-03  2:10     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:10 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses multi_io_quirk
for I/O HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

- no change

 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index adab903..413f984 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) = READ)
-			brq->data.blocks = 1;
-
 		/*
 		 * Some controllers have HW issues while operating
 		 * in multiple I/O mode
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index bfcf673..db4b4eb 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -272,7 +272,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 7/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-03  2:10     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-03  2:10 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses multi_io_quirk
for I/O HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

- no change

 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index adab903..413f984 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) == READ)
-			brq->data.blocks = 1;
-
 		/*
 		 * Some controllers have HW issues while operating
 		 * in multiple I/O mode
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index bfcf673..db4b4eb 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -272,7 +272,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* Re: [PATCH 1/7 v3] mmc: add .multi_io_quirk callback for multi I/O HW bug
  2014-09-03  2:08     ` Kuninori Morimoto
@ 2014-09-08  9:08       ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08  9:08 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:08, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Historically, we have been using MMC_CAP* to solve
> some issues, and current mmc block.c has
> MMC_CAP2_NO_MULTI_READ flag for multi I/O HW bug workaround.
> But it should be implemented under driver, not framework.
> This patch is prepare for it
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks! Applied for next.

I took the liberty of improving the commit message and fixed a
checkpatch warning.

Kind regards
Uffe


> ---
> v2 -> v3
>
>  - blk_size_workaround -> multi_io_quirk
>  - fixup comment/explain
>  - use MMC_DATA_READ/WRITE
>
>  drivers/mmc/card/block.c |   10 ++++++++++
>  include/linux/mmc/host.h |    7 +++++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index ede41f0..adab903 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1402,6 +1402,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>                 if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
>                     rq_data_dir(req) = READ)
>                         brq->data.blocks = 1;
> +
> +               /*
> +                * Some controllers have HW issues while operating
> +                * in multiple I/O mode
> +                */
> +               if (card->host->ops->multi_io_quirk)
> +                       brq->data.blocks = card->host->ops->multi_io_quirk(card,
> +                                               (rq_data_dir(req) = READ) ?
> +                                               MMC_DATA_READ : MMC_DATA_WRITE,
> +                                               brq->data.blocks);
>         }
>
>         if (brq->data.blocks > 1 || do_rel_wr) {
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 4cbf614..bfcf673 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -139,6 +139,13 @@ struct mmc_host_ops {
>         int     (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
>         void    (*hw_reset)(struct mmc_host *host);
>         void    (*card_event)(struct mmc_host *host);
> +
> +       /*
> +        * Optional callback to support controllers with HW issues for multiple I/O.
> +        * Returns the number of supported blocks for the request
> +        */
> +       int     (*multi_io_quirk)(struct mmc_card *card,
> +                                 unsigned int direction, int blk_size);
>  };
>
>  struct mmc_card;
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 1/7 v3] mmc: add .multi_io_quirk callback for multi I/O HW bug
@ 2014-09-08  9:08       ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08  9:08 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:08, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Historically, we have been using MMC_CAP* to solve
> some issues, and current mmc block.c has
> MMC_CAP2_NO_MULTI_READ flag for multi I/O HW bug workaround.
> But it should be implemented under driver, not framework.
> This patch is prepare for it
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks! Applied for next.

I took the liberty of improving the commit message and fixed a
checkpatch warning.

Kind regards
Uffe


> ---
> v2 -> v3
>
>  - blk_size_workaround -> multi_io_quirk
>  - fixup comment/explain
>  - use MMC_DATA_READ/WRITE
>
>  drivers/mmc/card/block.c |   10 ++++++++++
>  include/linux/mmc/host.h |    7 +++++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index ede41f0..adab903 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1402,6 +1402,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>                 if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
>                     rq_data_dir(req) == READ)
>                         brq->data.blocks = 1;
> +
> +               /*
> +                * Some controllers have HW issues while operating
> +                * in multiple I/O mode
> +                */
> +               if (card->host->ops->multi_io_quirk)
> +                       brq->data.blocks = card->host->ops->multi_io_quirk(card,
> +                                               (rq_data_dir(req) == READ) ?
> +                                               MMC_DATA_READ : MMC_DATA_WRITE,
> +                                               brq->data.blocks);
>         }
>
>         if (brq->data.blocks > 1 || do_rel_wr) {
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 4cbf614..bfcf673 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -139,6 +139,13 @@ struct mmc_host_ops {
>         int     (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
>         void    (*hw_reset)(struct mmc_host *host);
>         void    (*card_event)(struct mmc_host *host);
> +
> +       /*
> +        * Optional callback to support controllers with HW issues for multiple I/O.
> +        * Returns the number of supported blocks for the request
> +        */
> +       int     (*multi_io_quirk)(struct mmc_card *card,
> +                                 unsigned int direction, int blk_size);
>  };
>
>  struct mmc_card;
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-03  2:09     ` Kuninori Morimoto
@ 2014-09-08  9:10       ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08  9:10 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> 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 <kuninori.morimoto.gx@renesas.com>
> ---
> 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;

An option to adding yet another flag, would be to assign
->multi_io_quirk = omap_hsmmc_multi_io_quirk() here? Isn't that
actually better for those variants that doesn't suffer from this HW
bug?

Kind regards
Uffe


> +               host->flags |= HSMMC_NO_MULTI_READ;
>         }
>
>         pm_runtime_enable(host->dev);
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-08  9:10       ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08  9:10 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> 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 <kuninori.morimoto.gx@renesas.com>
> ---
> 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;

An option to adding yet another flag, would be to assign
->multi_io_quirk = omap_hsmmc_multi_io_quirk() here? Isn't that
actually better for those variants that doesn't suffer from this HW
bug?

Kind regards
Uffe


> +               host->flags |= HSMMC_NO_MULTI_READ;
>         }
>
>         pm_runtime_enable(host->dev);
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
  2014-09-03  2:09     ` Kuninori Morimoto
@ 2014-09-08 10:28       ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 10:28 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> 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>

Thanks! Applied for next!

Kind regards
Uffe

> ---
> 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
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
@ 2014-09-08 10:28       ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 10:28 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> 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>

Thanks! Applied for next!

Kind regards
Uffe

> ---
> 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
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-03  2:09     ` Kuninori Morimoto
@ 2014-09-08 10:43       ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 10:43 UTC (permalink / raw)
  To: Kuninori Morimoto, Lee Jones
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
>  include/linux/mfd/tmio.h        |    4 ++++

"mfd"? That was an odd place for storing the tmio mmc specific platform data.

So, we need an ack for the mfd maintainer on this one as well. Lee,
can you have a look?

Future wise, I would also suggest the include/linux/mfd/tmio.h to be
split up in proper pieces.

>  2 files changed, 17 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..ff5ff0f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
>         return ret;
>  }
>
> +static int tmio_multi_io_quirk(struct mmc_card *card,
> +                              unsigned int direction, int blk_size)
> +{
> +       struct tmio_mmc_host *host = mmc_priv(card->host);
> +       struct tmio_mmc_data *pdata = host->pdata;
> +
> +       if (pdata->multi_io_quirk)
> +               return pdata->multi_io_quirk(card, direction, blk_size);
> +
> +       return blk_size;
> +}
> +
>  static const struct mmc_host_ops tmio_mmc_ops = {
>         .request        = tmio_mmc_request,
>         .set_ios        = tmio_mmc_set_ios,
>         .get_ro         = tmio_mmc_get_ro,
>         .get_cd         = mmc_gpio_get_cd,
>         .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> +       .multi_io_quirk = tmio_multi_io_quirk,
>  };
>
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 90436d5..dec750e 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -1,10 +1,12 @@
>  #ifndef MFD_TMIO_H
>  #define MFD_TMIO_H
>
> +#include <linux/blkdev.h>

This isn't needed, right?

>  #include <linux/device.h>
>  #include <linux/fb.h>
>  #include <linux/io.h>
>  #include <linux/jiffies.h>
> +#include <linux/mmc/card.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>
> @@ -142,6 +144,8 @@ struct tmio_mmc_data {
>         /* clock management callbacks */
>         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>         void (*clk_disable)(struct platform_device *pdev);
> +       int (*multi_io_quirk)(struct mmc_card *card,
> +                             unsigned int direction, int blk_size);

Do you really need to invent new platform callbacks for this? Wouldn't
it be possible to let the driver handle the quirk by itself?


Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-08 10:43       ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 10:43 UTC (permalink / raw)
  To: Kuninori Morimoto, Lee Jones
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 3 September 2014 04:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
>  include/linux/mfd/tmio.h        |    4 ++++

"mfd"? That was an odd place for storing the tmio mmc specific platform data.

So, we need an ack for the mfd maintainer on this one as well. Lee,
can you have a look?

Future wise, I would also suggest the include/linux/mfd/tmio.h to be
split up in proper pieces.

>  2 files changed, 17 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..ff5ff0f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
>         return ret;
>  }
>
> +static int tmio_multi_io_quirk(struct mmc_card *card,
> +                              unsigned int direction, int blk_size)
> +{
> +       struct tmio_mmc_host *host = mmc_priv(card->host);
> +       struct tmio_mmc_data *pdata = host->pdata;
> +
> +       if (pdata->multi_io_quirk)
> +               return pdata->multi_io_quirk(card, direction, blk_size);
> +
> +       return blk_size;
> +}
> +
>  static const struct mmc_host_ops tmio_mmc_ops = {
>         .request        = tmio_mmc_request,
>         .set_ios        = tmio_mmc_set_ios,
>         .get_ro         = tmio_mmc_get_ro,
>         .get_cd         = mmc_gpio_get_cd,
>         .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> +       .multi_io_quirk = tmio_multi_io_quirk,
>  };
>
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 90436d5..dec750e 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -1,10 +1,12 @@
>  #ifndef MFD_TMIO_H
>  #define MFD_TMIO_H
>
> +#include <linux/blkdev.h>

This isn't needed, right?

>  #include <linux/device.h>
>  #include <linux/fb.h>
>  #include <linux/io.h>
>  #include <linux/jiffies.h>
> +#include <linux/mmc/card.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>
> @@ -142,6 +144,8 @@ struct tmio_mmc_data {
>         /* clock management callbacks */
>         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>         void (*clk_disable)(struct platform_device *pdev);
> +       int (*multi_io_quirk)(struct mmc_card *card,
> +                             unsigned int direction, int blk_size);

Do you really need to invent new platform callbacks for this? Wouldn't
it be possible to let the driver handle the quirk by itself?


Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
  2014-09-08 10:28       ` Ulf Hansson
@ 2014-09-08 10:53         ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 10:53 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 8 September 2014 12:28, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 3 September 2014 04:09, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>> 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>
>
> Thanks! Applied for next!

So I understand this one depends on patch 3, putting this on hold,
until we sorted out the comments I had.

Sorry for the noise!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile
@ 2014-09-08 10:53         ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 10:53 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 8 September 2014 12:28, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 3 September 2014 04:09, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>> 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>
>
> Thanks! Applied for next!

So I understand this one depends on patch 3, putting this on hold,
until we sorted out the comments I had.

Sorry for the noise!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-08 10:43       ` Ulf Hansson
@ 2014-09-08 11:11         ` Lee Jones
  -1 siblings, 0 replies; 118+ messages in thread
From: Lee Jones @ 2014-09-08 11:11 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Kuninori Morimoto, Chris Ball, Simon, Kuninori Morimoto,
	Linux-SH, linux-mmc

On Mon, 08 Sep 2014, Ulf Hansson wrote:

> On 3 September 2014 04:09, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
> >  include/linux/mfd/tmio.h        |    4 ++++
> 
> "mfd"? That was an odd place for storing the tmio mmc specific platform data.
> 
> So, we need an ack for the mfd maintainer on this one as well. Lee,
> can you have a look?
> 
> Future wise, I would also suggest the include/linux/mfd/tmio.h to be
> split up in proper pieces.

struct tmio_mmc_data looks like it's populated in the MFD driver, thus
this is probably the correct place for it.

> >  2 files changed, 17 insertions(+)
> >
> > diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> > index ba45413..ff5ff0f 100644
> > --- a/drivers/mmc/host/tmio_mmc_pio.c
> > +++ b/drivers/mmc/host/tmio_mmc_pio.c
> > @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
> >         return ret;
> >  }
> >
> > +static int tmio_multi_io_quirk(struct mmc_card *card,
> > +                              unsigned int direction, int blk_size)
> > +{
> > +       struct tmio_mmc_host *host = mmc_priv(card->host);
> > +       struct tmio_mmc_data *pdata = host->pdata;
> > +
> > +       if (pdata->multi_io_quirk)
> > +               return pdata->multi_io_quirk(card, direction, blk_size);
> > +
> > +       return blk_size;
> > +}
> > +
> >  static const struct mmc_host_ops tmio_mmc_ops = {
> >         .request        = tmio_mmc_request,
> >         .set_ios        = tmio_mmc_set_ios,
> >         .get_ro         = tmio_mmc_get_ro,
> >         .get_cd         = mmc_gpio_get_cd,
> >         .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> > +       .multi_io_quirk = tmio_multi_io_quirk,
> >  };
> >
> >  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> > diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> > index 90436d5..dec750e 100644
> > --- a/include/linux/mfd/tmio.h
> > +++ b/include/linux/mfd/tmio.h
> > @@ -1,10 +1,12 @@
> >  #ifndef MFD_TMIO_H
> >  #define MFD_TMIO_H
> >
> > +#include <linux/blkdev.h>
> 
> This isn't needed, right?
> 
> >  #include <linux/device.h>
> >  #include <linux/fb.h>
> >  #include <linux/io.h>
> >  #include <linux/jiffies.h>
> > +#include <linux/mmc/card.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/pm_runtime.h>
> >
> > @@ -142,6 +144,8 @@ struct tmio_mmc_data {
> >         /* clock management callbacks */
> >         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
> >         void (*clk_disable)(struct platform_device *pdev);
> > +       int (*multi_io_quirk)(struct mmc_card *card,
> > +                             unsigned int direction, int blk_size);
> 
> Do you really need to invent new platform callbacks for this? Wouldn't
> it be possible to let the driver handle the quirk by itself?

Obviously I can't Ack this patch until Ulf is satisfied.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-08 11:11         ` Lee Jones
  0 siblings, 0 replies; 118+ messages in thread
From: Lee Jones @ 2014-09-08 11:11 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Kuninori Morimoto, Chris Ball, Simon, Kuninori Morimoto,
	Linux-SH, linux-mmc

On Mon, 08 Sep 2014, Ulf Hansson wrote:

> On 3 September 2014 04:09, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
> >  include/linux/mfd/tmio.h        |    4 ++++
> 
> "mfd"? That was an odd place for storing the tmio mmc specific platform data.
> 
> So, we need an ack for the mfd maintainer on this one as well. Lee,
> can you have a look?
> 
> Future wise, I would also suggest the include/linux/mfd/tmio.h to be
> split up in proper pieces.

struct tmio_mmc_data looks like it's populated in the MFD driver, thus
this is probably the correct place for it.

> >  2 files changed, 17 insertions(+)
> >
> > diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> > index ba45413..ff5ff0f 100644
> > --- a/drivers/mmc/host/tmio_mmc_pio.c
> > +++ b/drivers/mmc/host/tmio_mmc_pio.c
> > @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
> >         return ret;
> >  }
> >
> > +static int tmio_multi_io_quirk(struct mmc_card *card,
> > +                              unsigned int direction, int blk_size)
> > +{
> > +       struct tmio_mmc_host *host = mmc_priv(card->host);
> > +       struct tmio_mmc_data *pdata = host->pdata;
> > +
> > +       if (pdata->multi_io_quirk)
> > +               return pdata->multi_io_quirk(card, direction, blk_size);
> > +
> > +       return blk_size;
> > +}
> > +
> >  static const struct mmc_host_ops tmio_mmc_ops = {
> >         .request        = tmio_mmc_request,
> >         .set_ios        = tmio_mmc_set_ios,
> >         .get_ro         = tmio_mmc_get_ro,
> >         .get_cd         = mmc_gpio_get_cd,
> >         .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> > +       .multi_io_quirk = tmio_multi_io_quirk,
> >  };
> >
> >  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> > diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> > index 90436d5..dec750e 100644
> > --- a/include/linux/mfd/tmio.h
> > +++ b/include/linux/mfd/tmio.h
> > @@ -1,10 +1,12 @@
> >  #ifndef MFD_TMIO_H
> >  #define MFD_TMIO_H
> >
> > +#include <linux/blkdev.h>
> 
> This isn't needed, right?
> 
> >  #include <linux/device.h>
> >  #include <linux/fb.h>
> >  #include <linux/io.h>
> >  #include <linux/jiffies.h>
> > +#include <linux/mmc/card.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/pm_runtime.h>
> >
> > @@ -142,6 +144,8 @@ struct tmio_mmc_data {
> >         /* clock management callbacks */
> >         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
> >         void (*clk_disable)(struct platform_device *pdev);
> > +       int (*multi_io_quirk)(struct mmc_card *card,
> > +                             unsigned int direction, int blk_size);
> 
> Do you really need to invent new platform callbacks for this? Wouldn't
> it be possible to let the driver handle the quirk by itself?

Obviously I can't Ack this patch until Ulf is satisfied.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-08 11:11         ` Lee Jones
@ 2014-09-08 11:45           ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 11:45 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuninori Morimoto, Chris Ball, Simon, Kuninori Morimoto,
	Linux-SH, linux-mmc

On 8 September 2014 13:11, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 08 Sep 2014, Ulf Hansson wrote:
>
>> On 3 September 2014 04:09, Kuninori Morimoto
>> <kuninori.morimoto.gx@gmail.com> wrote:
>> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> >
>> > Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
>> >  include/linux/mfd/tmio.h        |    4 ++++
>>
>> "mfd"? That was an odd place for storing the tmio mmc specific platform data.
>>
>> So, we need an ack for the mfd maintainer on this one as well. Lee,
>> can you have a look?
>>
>> Future wise, I would also suggest the include/linux/mfd/tmio.h to be
>> split up in proper pieces.
>
> struct tmio_mmc_data looks like it's populated in the MFD driver, thus
> this is probably the correct place for it.

You are right, just that we normally put these in
include/linux/platform_data/* nowadays. Similar applies to struct
tmio_nand_data and struct tmio_fb_data.

Additionally, struct tmio_mmc_dma, could be moved to mmc and may be
forward declared at wherever struct tmio_mmc_data is put.

I also found tmio_core_mmc_enable(), tmio_core_mmc_resume(),
tmio_core_mmc_pwr() and tmio_core_mmc_clk_div() - those could stay in
a local mfd subsystem header file instead of in /include/linux/...

Anyway, I just thought it make sense to clean it up, to possibly
prevent further unnecessary cross subsystem acks. :-)

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-08 11:45           ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-08 11:45 UTC (permalink / raw)
  To: Lee Jones
  Cc: Kuninori Morimoto, Chris Ball, Simon, Kuninori Morimoto,
	Linux-SH, linux-mmc

On 8 September 2014 13:11, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 08 Sep 2014, Ulf Hansson wrote:
>
>> On 3 September 2014 04:09, Kuninori Morimoto
>> <kuninori.morimoto.gx@gmail.com> wrote:
>> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> >
>> > Now, tmio_mmc 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/tmio_mmc_pio.c |   13 +++++++++++++
>> >  include/linux/mfd/tmio.h        |    4 ++++
>>
>> "mfd"? That was an odd place for storing the tmio mmc specific platform data.
>>
>> So, we need an ack for the mfd maintainer on this one as well. Lee,
>> can you have a look?
>>
>> Future wise, I would also suggest the include/linux/mfd/tmio.h to be
>> split up in proper pieces.
>
> struct tmio_mmc_data looks like it's populated in the MFD driver, thus
> this is probably the correct place for it.

You are right, just that we normally put these in
include/linux/platform_data/* nowadays. Similar applies to struct
tmio_nand_data and struct tmio_fb_data.

Additionally, struct tmio_mmc_dma, could be moved to mmc and may be
forward declared at wherever struct tmio_mmc_data is put.

I also found tmio_core_mmc_enable(), tmio_core_mmc_resume(),
tmio_core_mmc_pwr() and tmio_core_mmc_clk_div() - those could stay in
a local mfd subsystem header file instead of in /include/linux/...

Anyway, I just thought it make sense to clean it up, to possibly
prevent further unnecessary cross subsystem acks. :-)

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-08  9:10       ` Ulf Hansson
@ 2014-09-09  0:09         ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  0:09 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > 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;
> >  };
(snip)
> >  #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;
> 
> An option to adding yet another flag, would be to assign
> ->multi_io_quirk = omap_hsmmc_multi_io_quirk() here? Isn't that
> actually better for those variants that doesn't suffer from this HW
> bug?

This means we need to copy this ops for each driver ?
Otherwise, it breaks behavior if many drivers were probed.

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-09  0:09         ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  0:09 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > 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;
> >  };
(snip)
> >  #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;
> 
> An option to adding yet another flag, would be to assign
> ->multi_io_quirk = omap_hsmmc_multi_io_quirk() here? Isn't that
> actually better for those variants that doesn't suffer from this HW
> bug?

This means we need to copy this ops for each driver ?
Otherwise, it breaks behavior if many drivers were probed.

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-08 10:43       ` Ulf Hansson
@ 2014-09-09  0:14         ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  0:14 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Lee Jones, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > @@ -142,6 +144,8 @@ struct tmio_mmc_data {
> >         /* clock management callbacks */
> >         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
> >         void (*clk_disable)(struct platform_device *pdev);
> > +       int (*multi_io_quirk)(struct mmc_card *card,
> > +                             unsigned int direction, int blk_size);
> 
> Do you really need to invent new platform callbacks for this? Wouldn't
> it be possible to let the driver handle the quirk by itself?

sh_mobile_sdhi is based on tmio_mmc_xxx,
and sh_mobile_sdhi side needs this quirk.
I don't know original tmio_mmc_xxx HW.

Of course we can add new flag to tmio driver,
but, it is same way as before ?

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  0:14         ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  0:14 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Lee Jones, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > @@ -142,6 +144,8 @@ struct tmio_mmc_data {
> >         /* clock management callbacks */
> >         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
> >         void (*clk_disable)(struct platform_device *pdev);
> > +       int (*multi_io_quirk)(struct mmc_card *card,
> > +                             unsigned int direction, int blk_size);
> 
> Do you really need to invent new platform callbacks for this? Wouldn't
> it be possible to let the driver handle the quirk by itself?

sh_mobile_sdhi is based on tmio_mmc_xxx,
and sh_mobile_sdhi side needs this quirk.
I don't know original tmio_mmc_xxx HW.

Of course we can add new flag to tmio driver,
but, it is same way as before ?

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-03  2:08   ` Kuninori Morimoto
@ 2014-09-09  2:43     ` Simon Horman
  -1 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  2:43 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Tue, Sep 02, 2014 at 07:08:02PM -0700, Kuninori Morimoto wrote:
> 
> Hi Ulf, Chris, and Simon
> 
> These are v3 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.
> 
> Simon
> 5) and 6) are for sh-arm patches.
> Can you check it ?
> 
> Kuninori Morimoto (7):
>       mmc: add .multi_io_quirk callback for multi I/O HW bug
>       mmc: use .multi_io_quirk on omap_hsmmc
>       mmc: use .multi_io_quirk on tmio_mmc
>       mmc: use .multi_io_quirk on sh_mobile
>       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
>       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager

Hi Morimoto-san,

could you let me know about the dependencies for the above two patches?

>       mmc: remove MMC_CAP2_NO_MULTI_READ flags
> 
>  arch/arm/mach-shmobile/board-koelsch.c |    3 ---
>  arch/arm/mach-shmobile/board-lager.c   |    2 --
>  drivers/mmc/card/block.c               |   13 +++++++++----
>  drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
>  drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
>  drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
>  include/linux/mfd/tmio.h               |    4 ++++
>  include/linux/mmc/host.h               |    8 +++++++-
>  8 files changed, 68 insertions(+), 12 deletions(-)
> 
> Best regards
> ---
> Kuninori Morimoto
> 

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-09  2:43     ` Simon Horman
  0 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  2:43 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Tue, Sep 02, 2014 at 07:08:02PM -0700, Kuninori Morimoto wrote:
> 
> Hi Ulf, Chris, and Simon
> 
> These are v3 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.
> 
> Simon
> 5) and 6) are for sh-arm patches.
> Can you check it ?
> 
> Kuninori Morimoto (7):
>       mmc: add .multi_io_quirk callback for multi I/O HW bug
>       mmc: use .multi_io_quirk on omap_hsmmc
>       mmc: use .multi_io_quirk on tmio_mmc
>       mmc: use .multi_io_quirk on sh_mobile
>       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
>       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager

Hi Morimoto-san,

could you let me know about the dependencies for the above two patches?

>       mmc: remove MMC_CAP2_NO_MULTI_READ flags
> 
>  arch/arm/mach-shmobile/board-koelsch.c |    3 ---
>  arch/arm/mach-shmobile/board-lager.c   |    2 --
>  drivers/mmc/card/block.c               |   13 +++++++++----
>  drivers/mmc/host/omap_hsmmc.c          |   17 ++++++++++++++++-
>  drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
>  drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
>  include/linux/mfd/tmio.h               |    4 ++++
>  include/linux/mmc/host.h               |    8 +++++++-
>  8 files changed, 68 insertions(+), 12 deletions(-)
> 
> Best regards
> ---
> Kuninori Morimoto
> 

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-09  2:43     ` Simon Horman
@ 2014-09-09  2:45       ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  2:45 UTC (permalink / raw)
  To: Simon Horman
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Simon

> > Kuninori Morimoto (7):
> >       mmc: add .multi_io_quirk callback for multi I/O HW bug
> >       mmc: use .multi_io_quirk on omap_hsmmc
> >       mmc: use .multi_io_quirk on tmio_mmc
> >       mmc: use .multi_io_quirk on sh_mobile
> >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
> >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
> 
> Hi Morimoto-san,
> 
> could you let me know about the dependencies for the above two patches?

These have deep dependencies.
"ARM: shmobile: remove xxx" patches are based on 1) - 4) patches,
and, it is required to last patch.

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-09  2:45       ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  2:45 UTC (permalink / raw)
  To: Simon Horman
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Simon

> > Kuninori Morimoto (7):
> >       mmc: add .multi_io_quirk callback for multi I/O HW bug
> >       mmc: use .multi_io_quirk on omap_hsmmc
> >       mmc: use .multi_io_quirk on tmio_mmc
> >       mmc: use .multi_io_quirk on sh_mobile
> >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
> >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
> 
> Hi Morimoto-san,
> 
> could you let me know about the dependencies for the above two patches?

These have deep dependencies.
"ARM: shmobile: remove xxx" patches are based on 1) - 4) patches,
and, it is required to last patch.

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-09  2:45       ` Kuninori Morimoto
@ 2014-09-09  3:56         ` Simon Horman
  -1 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  3:56 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Mon, Sep 08, 2014 at 07:45:46PM -0700, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > > Kuninori Morimoto (7):
> > >       mmc: add .multi_io_quirk callback for multi I/O HW bug
> > >       mmc: use .multi_io_quirk on omap_hsmmc
> > >       mmc: use .multi_io_quirk on tmio_mmc
> > >       mmc: use .multi_io_quirk on sh_mobile
> > >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
> > >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
> > 
> > Hi Morimoto-san,
> > 
> > could you let me know about the dependencies for the above two patches?
> 
> These have deep dependencies.
> "ARM: shmobile: remove xxx" patches are based on 1) - 4) patches,
> and, it is required to last patch.

Thanks, I understand.

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-09  3:56         ` Simon Horman
  0 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  3:56 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Mon, Sep 08, 2014 at 07:45:46PM -0700, Kuninori Morimoto wrote:
> 
> Hi Simon
> 
> > > Kuninori Morimoto (7):
> > >       mmc: add .multi_io_quirk callback for multi I/O HW bug
> > >       mmc: use .multi_io_quirk on omap_hsmmc
> > >       mmc: use .multi_io_quirk on tmio_mmc
> > >       mmc: use .multi_io_quirk on sh_mobile
> > >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
> > >       ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
> > 
> > Hi Morimoto-san,
> > 
> > could you let me know about the dependencies for the above two patches?
> 
> These have deep dependencies.
> "ARM: shmobile: remove xxx" patches are based on 1) - 4) patches,
> and, it is required to last patch.

Thanks, I understand.

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-09  0:09         ` Kuninori Morimoto
@ 2014-09-09  6:00           ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  6:00 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 02:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
>> > 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;
>> >  };
> (snip)
>> >  #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;
>>
>> An option to adding yet another flag, would be to assign
>> ->multi_io_quirk = omap_hsmmc_multi_io_quirk() here? Isn't that
>> actually better for those variants that doesn't suffer from this HW
>> bug?
>
> This means we need to copy this ops for each driver ?
> Otherwise, it breaks behavior if many drivers were probed.

The are only one driver for omap_hsmmc, this is not tmio, which
certainly is a different story.

What you need to do, is to make omap_hsmmc_ops non const - and assign
the function pointer here. That should work.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-09  6:00           ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  6:00 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 02:09, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
>> > 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;
>> >  };
> (snip)
>> >  #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;
>>
>> An option to adding yet another flag, would be to assign
>> ->multi_io_quirk = omap_hsmmc_multi_io_quirk() here? Isn't that
>> actually better for those variants that doesn't suffer from this HW
>> bug?
>
> This means we need to copy this ops for each driver ?
> Otherwise, it breaks behavior if many drivers were probed.

The are only one driver for omap_hsmmc, this is not tmio, which
certainly is a different story.

What you need to do, is to make omap_hsmmc_ops non const - and assign
the function pointer here. That should work.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-09  6:00           ` Ulf Hansson
@ 2014-09-09  6:07             ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:07 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > This means we need to copy this ops for each driver ?
> > Otherwise, it breaks behavior if many drivers were probed.
> 
> The are only one driver for omap_hsmmc, this is not tmio, which
> certainly is a different story.
> 
> What you need to do, is to make omap_hsmmc_ops non const - and assign
> the function pointer here. That should work.

I meant this case

omap_hsmmc@0 0xAAAAAA irq = xxxx (MULTI read workaround is needed)
omap_hsmmc@1 0xBBBBBB irq = yyyy (MULTI read workaround is not needed)

Maybe current omap doesn't have 2 hsmmc on 1 SoC (I don't know)
but, we don't know the future ?
Of course I can follow your style if this issue never happen

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-09  6:07             ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:07 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > This means we need to copy this ops for each driver ?
> > Otherwise, it breaks behavior if many drivers were probed.
> 
> The are only one driver for omap_hsmmc, this is not tmio, which
> certainly is a different story.
> 
> What you need to do, is to make omap_hsmmc_ops non const - and assign
> the function pointer here. That should work.

I meant this case

omap_hsmmc@0 0xAAAAAA irq = xxxx (MULTI read workaround is needed)
omap_hsmmc@1 0xBBBBBB irq = yyyy (MULTI read workaround is not needed)

Maybe current omap doesn't have 2 hsmmc on 1 SoC (I don't know)
but, we don't know the future ?
Of course I can follow your style if this issue never happen

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-09  0:14         ` Kuninori Morimoto
@ 2014-09-09  6:32           ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  6:32 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Lee Jones, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 02:14, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
>> > @@ -142,6 +144,8 @@ struct tmio_mmc_data {
>> >         /* clock management callbacks */
>> >         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>> >         void (*clk_disable)(struct platform_device *pdev);
>> > +       int (*multi_io_quirk)(struct mmc_card *card,
>> > +                             unsigned int direction, int blk_size);
>>
>> Do you really need to invent new platform callbacks for this? Wouldn't
>> it be possible to let the driver handle the quirk by itself?
>
> sh_mobile_sdhi is based on tmio_mmc_xxx,
> and sh_mobile_sdhi side needs this quirk.
> I don't know original tmio_mmc_xxx HW.
>
> Of course we can add new flag to tmio driver,
> but, it is same way as before ?

You are right, let's keep this patch as is, besides the "#include
<linux/blkdev.h>", which isn't needed.

Sorry for the noise.

Kind regards
Uffe

>
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  6:32           ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  6:32 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Lee Jones, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 02:14, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
>> > @@ -142,6 +144,8 @@ struct tmio_mmc_data {
>> >         /* clock management callbacks */
>> >         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>> >         void (*clk_disable)(struct platform_device *pdev);
>> > +       int (*multi_io_quirk)(struct mmc_card *card,
>> > +                             unsigned int direction, int blk_size);
>>
>> Do you really need to invent new platform callbacks for this? Wouldn't
>> it be possible to let the driver handle the quirk by itself?
>
> sh_mobile_sdhi is based on tmio_mmc_xxx,
> and sh_mobile_sdhi side needs this quirk.
> I don't know original tmio_mmc_xxx HW.
>
> Of course we can add new flag to tmio driver,
> but, it is same way as before ?

You are right, let's keep this patch as is, besides the "#include
<linux/blkdev.h>", which isn't needed.

Sorry for the noise.

Kind regards
Uffe

>
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-09  6:32           ` Ulf Hansson
@ 2014-09-09  6:33             ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:33 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Lee Jones, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > sh_mobile_sdhi is based on tmio_mmc_xxx,
> > and sh_mobile_sdhi side needs this quirk.
> > I don't know original tmio_mmc_xxx HW.
> >
> > Of course we can add new flag to tmio driver,
> > but, it is same way as before ?
> 
> You are right, let's keep this patch as is, besides the "#include
> <linux/blkdev.h>", which isn't needed.
> 
> Sorry for the noise.

no problem
Please let me know if you need v4 patch

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 3/7 v3] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  6:33             ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:33 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Lee Jones, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > sh_mobile_sdhi is based on tmio_mmc_xxx,
> > and sh_mobile_sdhi side needs this quirk.
> > I don't know original tmio_mmc_xxx HW.
> >
> > Of course we can add new flag to tmio driver,
> > but, it is same way as before ?
> 
> You are right, let's keep this patch as is, besides the "#include
> <linux/blkdev.h>", which isn't needed.
> 
> Sorry for the noise.

no problem
Please let me know if you need v4 patch

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-09  6:07             ` Kuninori Morimoto
@ 2014-09-09  6:36               ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  6:36 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 08:07, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
>> > This means we need to copy this ops for each driver ?
>> > Otherwise, it breaks behavior if many drivers were probed.
>>
>> The are only one driver for omap_hsmmc, this is not tmio, which
>> certainly is a different story.
>>
>> What you need to do, is to make omap_hsmmc_ops non const - and assign
>> the function pointer here. That should work.
>
> I meant this case
>
> omap_hsmmc@0 0xAAAAAA irq = xxxx (MULTI read workaround is needed)
> omap_hsmmc@1 0xBBBBBB irq = yyyy (MULTI read workaround is not needed)
>
> Maybe current omap doesn't have 2 hsmmc on 1 SoC (I don't know)
> but, we don't know the future ?
> Of course I can follow your style if this issue never happen

The above can be handled by having different omap variants structs,
like how mmci does it. Also, I don't think we need to worry about that
now. So please adopt to my proposal.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-09  6:36               ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  6:36 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 08:07, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
>> > This means we need to copy this ops for each driver ?
>> > Otherwise, it breaks behavior if many drivers were probed.
>>
>> The are only one driver for omap_hsmmc, this is not tmio, which
>> certainly is a different story.
>>
>> What you need to do, is to make omap_hsmmc_ops non const - and assign
>> the function pointer here. That should work.
>
> I meant this case
>
> omap_hsmmc@0 0xAAAAAA irq = xxxx (MULTI read workaround is needed)
> omap_hsmmc@1 0xBBBBBB irq = yyyy (MULTI read workaround is not needed)
>
> Maybe current omap doesn't have 2 hsmmc on 1 SoC (I don't know)
> but, we don't know the future ?
> Of course I can follow your style if this issue never happen

The above can be handled by having different omap variants structs,
like how mmci does it. Also, I don't think we need to worry about that
now. So please adopt to my proposal.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-09  6:36               ` Ulf Hansson
@ 2014-09-09  6:39                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:39 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > omap_hsmmc@0 0xAAAAAA irq = xxxx (MULTI read workaround is needed)
> > omap_hsmmc@1 0xBBBBBB irq = yyyy (MULTI read workaround is not needed)
> >
> > Maybe current omap doesn't have 2 hsmmc on 1 SoC (I don't know)
> > but, we don't know the future ?
> > Of course I can follow your style if this issue never happen
> 
> The above can be handled by having different omap variants structs,
> like how mmci does it. Also, I don't think we need to worry about that
> now. So please adopt to my proposal.

OK, I send patch soon

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/7 v3] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-09  6:39                 ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:39 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf

> > omap_hsmmc@0 0xAAAAAA irq = xxxx (MULTI read workaround is needed)
> > omap_hsmmc@1 0xBBBBBB irq = yyyy (MULTI read workaround is not needed)
> >
> > Maybe current omap doesn't have 2 hsmmc on 1 SoC (I don't know)
> > but, we don't know the future ?
> > Of course I can follow your style if this issue never happen
> 
> The above can be handled by having different omap variants structs,
> like how mmci does it. Also, I don't think we need to worry about that
> now. So please adopt to my proposal.

OK, I send patch soon

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-01  9:20 ` Kuninori Morimoto
@ 2014-09-09  6:43   ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:43 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These are v4 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.

Simon
4) and 5) are for sh-arm patches.
Can you check these, and give it your Acked-by ?

Kuninori Morimoto (6):
      1) mmc: use .multi_io_quirk on omap_hsmmc
      2) mmc: use .multi_io_quirk on tmio_mmc
      3) mmc: use .multi_io_quirk on sh_mobile
      4) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
      5) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
      6) mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |    5 -----
 drivers/mmc/host/omap_hsmmc.c          |   14 ++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    3 +++
 include/linux/mmc/host.h               |    1 -
 8 files changed, 47 insertions(+), 14 deletions(-)


Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 0/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-09  6:43   ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:43 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc


Hi Ulf, Chris, and Simon

These are v4 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.

Simon
4) and 5) are for sh-arm patches.
Can you check these, and give it your Acked-by ?

Kuninori Morimoto (6):
      1) mmc: use .multi_io_quirk on omap_hsmmc
      2) mmc: use .multi_io_quirk on tmio_mmc
      3) mmc: use .multi_io_quirk on sh_mobile
      4) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
      5) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
      6) mmc: remove MMC_CAP2_NO_MULTI_READ flags

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 arch/arm/mach-shmobile/board-lager.c   |    2 --
 drivers/mmc/card/block.c               |    5 -----
 drivers/mmc/host/omap_hsmmc.c          |   14 ++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
 include/linux/mfd/tmio.h               |    3 +++
 include/linux/mmc/host.h               |    1 -
 8 files changed, 47 insertions(+), 14 deletions(-)


Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* [PATCH 1/6 v4] mmc: use .multi_io_quirk on omap_hsmmc
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09  6:44     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:44 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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 <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

 - don't use flag

 drivers/mmc/host/omap_hsmmc.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ece1634..df27bb4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1829,7 +1829,17 @@ static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
 	return 0;
 }
 
-static const struct mmc_host_ops omap_hsmmc_ops = {
+static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
+				     unsigned int direction, int blk_size)
+{
+	/* This controller can't do multiblock reads due to hw bugs */
+	if (direction = MMC_DATA_READ)
+		return 1;
+
+	return blk_size;
+}
+
+static struct mmc_host_ops omap_hsmmc_ops = {
 	.enable = omap_hsmmc_enable_fclk,
 	.disable = omap_hsmmc_disable_fclk,
 	.post_req = omap_hsmmc_post_req,
@@ -2101,7 +2111,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;
+		omap_hsmmc_ops.multi_io_quirk = omap_hsmmc_multi_io_quirk;
 	}
 
 	pm_runtime_enable(host->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 1/6 v4] mmc: use .multi_io_quirk on omap_hsmmc
@ 2014-09-09  6:44     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:44 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

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 <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

 - don't use flag

 drivers/mmc/host/omap_hsmmc.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ece1634..df27bb4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1829,7 +1829,17 @@ static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
 	return 0;
 }
 
-static const struct mmc_host_ops omap_hsmmc_ops = {
+static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
+				     unsigned int direction, int blk_size)
+{
+	/* This controller can't do multiblock reads due to hw bugs */
+	if (direction == MMC_DATA_READ)
+		return 1;
+
+	return blk_size;
+}
+
+static struct mmc_host_ops omap_hsmmc_ops = {
 	.enable = omap_hsmmc_enable_fclk,
 	.disable = omap_hsmmc_disable_fclk,
 	.post_req = omap_hsmmc_post_req,
@@ -2101,7 +2111,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;
+		omap_hsmmc_ops.multi_io_quirk = omap_hsmmc_multi_io_quirk;
 	}
 
 	pm_runtime_enable(host->dev);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09  6:45     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:45 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc 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>
---
v3 -> v4

 - remove un-needed header

 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    3 +++
 2 files changed, 16 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..ff5ff0f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_multi_io_quirk(struct mmc_card *card,
+			       unsigned int direction, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->multi_io_quirk)
+		return pdata->multi_io_quirk(card, direction, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.multi_io_quirk	= tmio_multi_io_quirk,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..5738817 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -5,6 +5,7 @@
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +143,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*multi_io_quirk)(struct mmc_card *card,
+			      unsigned int direction, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  6:45     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:45 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, tmio_mmc 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>
---
v3 -> v4

 - remove un-needed header

 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    3 +++
 2 files changed, 16 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..ff5ff0f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_multi_io_quirk(struct mmc_card *card,
+			       unsigned int direction, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->multi_io_quirk)
+		return pdata->multi_io_quirk(card, direction, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.multi_io_quirk	= tmio_multi_io_quirk,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..5738817 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -5,6 +5,7 @@
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +143,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*multi_io_quirk)(struct mmc_card *card,
+			      unsigned int direction, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/6 v4] mmc: use .multi_io_quirk on sh_mobile
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09  6:45     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:45 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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>
---
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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 3/6 v4] mmc: use .multi_io_quirk on sh_mobile
@ 2014-09-09  6:45     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:45 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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>
---
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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09  6:46     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:46 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

 - no change

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 4/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
@ 2014-09-09  6:46     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:46 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

 - no change

 arch/arm/mach-shmobile/board-koelsch.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..126a8b4 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09  6:46     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:46 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

- no change

 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 5/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
@ 2014-09-09  6:46     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:46 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

sh_mobile_sdhi cares multiblock read bug.
remove MMC_CAP2_NO_MULTI_READ flag from board code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

- no change

 arch/arm/mach-shmobile/board-lager.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..f5a98e2 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
 static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
 static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
 	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
 			  MMC_CAP_POWER_OFF_CARD,
-	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09  6:46     ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:46 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses multi_io_quirk
for I/O HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

 - no change

 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index adab903..413f984 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) = READ)
-			brq->data.blocks = 1;
-
 		/*
 		 * Some controllers have HW issues while operating
 		 * in multiple I/O mode
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 10e2bd6..797ae65 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -272,7 +272,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* [PATCH 6/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-09  6:46     ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  6:46 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball, Simon; +Cc: Kuninori Morimoto, Linux-SH, linux-mmc

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

Now, mmc framework uses multi_io_quirk
for I/O HW bug workaround.
MMC_CAP2_NO_MULTI_READ flag is no longer needed

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v3 -> v4

 - no change

 drivers/mmc/card/block.c |    5 -----
 include/linux/mmc/host.h |    1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index adab903..413f984 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1398,11 +1398,6 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 		if (disable_multi)
 			brq->data.blocks = 1;
 
-		/* Some controllers can't do multiblock reads due to hw bugs */
-		if (card->host->caps2 & MMC_CAP2_NO_MULTI_READ &&
-		    rq_data_dir(req) == READ)
-			brq->data.blocks = 1;
-
 		/*
 		 * Some controllers have HW issues while operating
 		 * in multiple I/O mode
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 10e2bd6..797ae65 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -272,7 +272,6 @@ struct mmc_host {
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
-#define MMC_CAP2_NO_MULTI_READ	(1 << 3)	/* Multiblock reads don't work */
 #define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
 #define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
 #define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-09  6:45     ` Kuninori Morimoto
@ 2014-09-09  7:00       ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  7:00 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 08:45, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Now, tmio_mmc 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>
> ---
> v3 -> v4
>
>  - remove un-needed header
>
>  drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
>  include/linux/mfd/tmio.h        |    3 +++

You need to send this to Lee as well, to request his ack for mfd.

Kind regards
Uffe

>  2 files changed, 16 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..ff5ff0f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
>         return ret;
>  }
>
> +static int tmio_multi_io_quirk(struct mmc_card *card,
> +                              unsigned int direction, int blk_size)
> +{
> +       struct tmio_mmc_host *host = mmc_priv(card->host);
> +       struct tmio_mmc_data *pdata = host->pdata;
> +
> +       if (pdata->multi_io_quirk)
> +               return pdata->multi_io_quirk(card, direction, blk_size);
> +
> +       return blk_size;
> +}
> +
>  static const struct mmc_host_ops tmio_mmc_ops = {
>         .request        = tmio_mmc_request,
>         .set_ios        = tmio_mmc_set_ios,
>         .get_ro         = tmio_mmc_get_ro,
>         .get_cd         = mmc_gpio_get_cd,
>         .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> +       .multi_io_quirk = tmio_multi_io_quirk,
>  };
>
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 90436d5..5738817 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -5,6 +5,7 @@
>  #include <linux/fb.h>
>  #include <linux/io.h>
>  #include <linux/jiffies.h>
> +#include <linux/mmc/card.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>
> @@ -142,6 +143,8 @@ struct tmio_mmc_data {
>         /* clock management callbacks */
>         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>         void (*clk_disable)(struct platform_device *pdev);
> +       int (*multi_io_quirk)(struct mmc_card *card,
> +                             unsigned int direction, int blk_size);
>  };
>
>  /*
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  7:00       ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09  7:00 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On 9 September 2014 08:45, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Now, tmio_mmc 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>
> ---
> v3 -> v4
>
>  - remove un-needed header
>
>  drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
>  include/linux/mfd/tmio.h        |    3 +++

You need to send this to Lee as well, to request his ack for mfd.

Kind regards
Uffe

>  2 files changed, 16 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..ff5ff0f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
>         return ret;
>  }
>
> +static int tmio_multi_io_quirk(struct mmc_card *card,
> +                              unsigned int direction, int blk_size)
> +{
> +       struct tmio_mmc_host *host = mmc_priv(card->host);
> +       struct tmio_mmc_data *pdata = host->pdata;
> +
> +       if (pdata->multi_io_quirk)
> +               return pdata->multi_io_quirk(card, direction, blk_size);
> +
> +       return blk_size;
> +}
> +
>  static const struct mmc_host_ops tmio_mmc_ops = {
>         .request        = tmio_mmc_request,
>         .set_ios        = tmio_mmc_set_ios,
>         .get_ro         = tmio_mmc_get_ro,
>         .get_cd         = mmc_gpio_get_cd,
>         .enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> +       .multi_io_quirk = tmio_multi_io_quirk,
>  };
>
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 90436d5..5738817 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -5,6 +5,7 @@
>  #include <linux/fb.h>
>  #include <linux/io.h>
>  #include <linux/jiffies.h>
> +#include <linux/mmc/card.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>
> @@ -142,6 +143,8 @@ struct tmio_mmc_data {
>         /* clock management callbacks */
>         int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>         void (*clk_disable)(struct platform_device *pdev);
> +       int (*multi_io_quirk)(struct mmc_card *card,
> +                             unsigned int direction, int blk_size);
>  };
>
>  /*
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-09  6:45     ` Kuninori Morimoto
@ 2014-09-09  7:04       ` Kuninori Morimoto
  -1 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  7:04 UTC (permalink / raw)
  To: Lee Jones
  Cc: Ulf Hansson, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

Hi Lee

I forgot to add you on this patch.
Can you please check this patch from "mfd" point ?

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

Now, tmio_mmc 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>
---
v3 -> v4

 - remove un-needed header

 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    3 +++
 2 files changed, 16 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..ff5ff0f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_multi_io_quirk(struct mmc_card *card,
+			       unsigned int direction, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->multi_io_quirk)
+		return pdata->multi_io_quirk(card, direction, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.multi_io_quirk	= tmio_multi_io_quirk,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..5738817 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -5,6 +5,7 @@
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +143,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*multi_io_quirk)(struct mmc_card *card,
+			      unsigned int direction, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  7:04       ` Kuninori Morimoto
  0 siblings, 0 replies; 118+ messages in thread
From: Kuninori Morimoto @ 2014-09-09  7:04 UTC (permalink / raw)
  To: Lee Jones
  Cc: Ulf Hansson, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

Hi Lee

I forgot to add you on this patch.
Can you please check this patch from "mfd" point ?

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

Now, tmio_mmc 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>
---
v3 -> v4

 - remove un-needed header

 drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
 include/linux/mfd/tmio.h        |    3 +++
 2 files changed, 16 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..ff5ff0f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
 	return ret;
 }
 
+static int tmio_multi_io_quirk(struct mmc_card *card,
+			       unsigned int direction, int blk_size)
+{
+	struct tmio_mmc_host *host = mmc_priv(card->host);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->multi_io_quirk)
+		return pdata->multi_io_quirk(card, direction, blk_size);
+
+	return blk_size;
+}
+
 static const struct mmc_host_ops tmio_mmc_ops = {
 	.request	= tmio_mmc_request,
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= mmc_gpio_get_cd,
 	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
+	.multi_io_quirk	= tmio_multi_io_quirk,
 };
 
 static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 90436d5..5738817 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -5,6 +5,7 @@
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
+#include <linux/mmc/card.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 
@@ -142,6 +143,8 @@ struct tmio_mmc_data {
 	/* clock management callbacks */
 	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
 	void (*clk_disable)(struct platform_device *pdev);
+	int (*multi_io_quirk)(struct mmc_card *card,
+			      unsigned int direction, int blk_size);
 };
 
 /*
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
  2014-09-09  7:04       ` Kuninori Morimoto
@ 2014-09-09  7:23         ` Lee Jones
  -1 siblings, 0 replies; 118+ messages in thread
From: Lee Jones @ 2014-09-09  7:23 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On Tue, 09 Sep 2014, Kuninori Morimoto wrote:

> Hi Lee
> 
> I forgot to add you on this patch.
> Can you please check this patch from "mfd" point ?
> 
> ------------------------------
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Now, tmio_mmc 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>
> ---
> v3 -> v4
> 
>  - remove un-needed header
> 
>  drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
>  include/linux/mfd/tmio.h        |    3 +++

For the MFD changes:
  Acked-by: Lee Jones <lee.jones@linaro.org>

>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..ff5ff0f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
>  	return ret;
>  }
>  
> +static int tmio_multi_io_quirk(struct mmc_card *card,
> +			       unsigned int direction, int blk_size)
> +{
> +	struct tmio_mmc_host *host = mmc_priv(card->host);
> +	struct tmio_mmc_data *pdata = host->pdata;
> +
> +	if (pdata->multi_io_quirk)
> +		return pdata->multi_io_quirk(card, direction, blk_size);
> +
> +	return blk_size;
> +}
> +
>  static const struct mmc_host_ops tmio_mmc_ops = {
>  	.request	= tmio_mmc_request,
>  	.set_ios	= tmio_mmc_set_ios,
>  	.get_ro         = tmio_mmc_get_ro,
>  	.get_cd		= mmc_gpio_get_cd,
>  	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> +	.multi_io_quirk	= tmio_multi_io_quirk,
>  };
>  
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 90436d5..5738817 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -5,6 +5,7 @@
>  #include <linux/fb.h>
>  #include <linux/io.h>
>  #include <linux/jiffies.h>
> +#include <linux/mmc/card.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
> @@ -142,6 +143,8 @@ struct tmio_mmc_data {
>  	/* clock management callbacks */
>  	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>  	void (*clk_disable)(struct platform_device *pdev);
> +	int (*multi_io_quirk)(struct mmc_card *card,
> +			      unsigned int direction, int blk_size);
>  };
>  
>  /*

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc
@ 2014-09-09  7:23         ` Lee Jones
  0 siblings, 0 replies; 118+ messages in thread
From: Lee Jones @ 2014-09-09  7:23 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc

On Tue, 09 Sep 2014, Kuninori Morimoto wrote:

> Hi Lee
> 
> I forgot to add you on this patch.
> Can you please check this patch from "mfd" point ?
> 
> ------------------------------
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Now, tmio_mmc 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>
> ---
> v3 -> v4
> 
>  - remove un-needed header
> 
>  drivers/mmc/host/tmio_mmc_pio.c |   13 +++++++++++++
>  include/linux/mfd/tmio.h        |    3 +++

For the MFD changes:
  Acked-by: Lee Jones <lee.jones@linaro.org>

>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..ff5ff0f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -970,12 +970,25 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
>  	return ret;
>  }
>  
> +static int tmio_multi_io_quirk(struct mmc_card *card,
> +			       unsigned int direction, int blk_size)
> +{
> +	struct tmio_mmc_host *host = mmc_priv(card->host);
> +	struct tmio_mmc_data *pdata = host->pdata;
> +
> +	if (pdata->multi_io_quirk)
> +		return pdata->multi_io_quirk(card, direction, blk_size);
> +
> +	return blk_size;
> +}
> +
>  static const struct mmc_host_ops tmio_mmc_ops = {
>  	.request	= tmio_mmc_request,
>  	.set_ios	= tmio_mmc_set_ios,
>  	.get_ro         = tmio_mmc_get_ro,
>  	.get_cd		= mmc_gpio_get_cd,
>  	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
> +	.multi_io_quirk	= tmio_multi_io_quirk,
>  };
>  
>  static int tmio_mmc_init_ocr(struct tmio_mmc_host *host)
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index 90436d5..5738817 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -5,6 +5,7 @@
>  #include <linux/fb.h>
>  #include <linux/io.h>
>  #include <linux/jiffies.h>
> +#include <linux/mmc/card.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  
> @@ -142,6 +143,8 @@ struct tmio_mmc_data {
>  	/* clock management callbacks */
>  	int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
>  	void (*clk_disable)(struct platform_device *pdev);
> +	int (*multi_io_quirk)(struct mmc_card *card,
> +			      unsigned int direction, int blk_size);
>  };
>  
>  /*

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 4/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
  2014-09-09  6:46     ` Kuninori Morimoto
@ 2014-09-09  8:20       ` Simon Horman
  -1 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  8:20 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Mon, Sep 08, 2014 at 11:46:10PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> sh_mobile_sdhi cares multiblock read bug.
> remove MMC_CAP2_NO_MULTI_READ flag from board code
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> v3 -> v4
> 
>  - no change
> 
>  arch/arm/mach-shmobile/board-koelsch.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
> index b7d5bc7..126a8b4 100644
> --- a/arch/arm/mach-shmobile/board-koelsch.c
> +++ b/arch/arm/mach-shmobile/board-koelsch.c
> @@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
>  static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
>  };
>  
> @@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
>  static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
>  };
>  
> @@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
>  static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
>  			  TMIO_MMC_WRPROTECT_DISABLE,
>  };
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 4/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
@ 2014-09-09  8:20       ` Simon Horman
  0 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  8:20 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Mon, Sep 08, 2014 at 11:46:10PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> sh_mobile_sdhi cares multiblock read bug.
> remove MMC_CAP2_NO_MULTI_READ flag from board code
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> v3 -> v4
> 
>  - no change
> 
>  arch/arm/mach-shmobile/board-koelsch.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
> index b7d5bc7..126a8b4 100644
> --- a/arch/arm/mach-shmobile/board-koelsch.c
> +++ b/arch/arm/mach-shmobile/board-koelsch.c
> @@ -331,7 +331,6 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
>  static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
>  };
>  
> @@ -344,7 +343,6 @@ static struct resource sdhi0_resources[] __initdata = {
>  static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
>  };
>  
> @@ -357,7 +355,6 @@ static struct resource sdhi1_resources[] __initdata = {
>  static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
>  			  TMIO_MMC_WRPROTECT_DISABLE,
>  };
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 5/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
  2014-09-09  6:46     ` Kuninori Morimoto
@ 2014-09-09  8:21       ` Simon Horman
  -1 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  8:21 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Mon, Sep 08, 2014 at 11:46:32PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> sh_mobile_sdhi cares multiblock read bug.
> remove MMC_CAP2_NO_MULTI_READ flag from board code
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> v3 -> v4
> 
> - no change
> 
>  arch/arm/mach-shmobile/board-lager.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> index e1d8215..f5a98e2 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
> @@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
>  static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
>  			  TMIO_MMC_WRPROTECT_DISABLE,
>  };
> @@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
>  static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
>  			  TMIO_MMC_WRPROTECT_DISABLE,
>  };
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 5/6 v4] ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
@ 2014-09-09  8:21       ` Simon Horman
  0 siblings, 0 replies; 118+ messages in thread
From: Simon Horman @ 2014-09-09  8:21 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Chris Ball, Kuninori Morimoto, Linux-SH, linux-mmc

On Mon, Sep 08, 2014 at 11:46:32PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> sh_mobile_sdhi cares multiblock read bug.
> remove MMC_CAP2_NO_MULTI_READ flag from board code
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> v3 -> v4
> 
> - no change
> 
>  arch/arm/mach-shmobile/board-lager.c |    2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> index e1d8215..f5a98e2 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
> @@ -630,7 +630,6 @@ static void __init lager_add_rsnd_device(void)
>  static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
>  			  TMIO_MMC_WRPROTECT_DISABLE,
>  };
> @@ -644,7 +643,6 @@ static struct resource sdhi0_resources[] __initdata = {
>  static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
>  	.tmio_caps	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
>  			  MMC_CAP_POWER_OFF_CARD,
> -	.tmio_caps2	= MMC_CAP2_NO_MULTI_READ,
>  	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
>  			  TMIO_MMC_WRPROTECT_DISABLE,
>  };
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags
  2014-09-09  6:43   ` Kuninori Morimoto
@ 2014-09-09 12:19     ` Ulf Hansson
  -1 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09 12:19 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc, Lee Jones

On 9 September 2014 08:43, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf, Chris, and Simon
>
> These are v4 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.
>
> Simon
> 4) and 5) are for sh-arm patches.
> Can you check these, and give it your Acked-by ?
>
> Kuninori Morimoto (6):
>       1) mmc: use .multi_io_quirk on omap_hsmmc
>       2) mmc: use .multi_io_quirk on tmio_mmc
>       3) mmc: use .multi_io_quirk on sh_mobile
>       4) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
>       5) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
>       6) mmc: remove MMC_CAP2_NO_MULTI_READ flags

Thanks! Applied for next, with Simon's and Lee's acks.

Kind regards
Uffe

>
>  arch/arm/mach-shmobile/board-koelsch.c |    3 ---
>  arch/arm/mach-shmobile/board-lager.c   |    2 --
>  drivers/mmc/card/block.c               |    5 -----
>  drivers/mmc/host/omap_hsmmc.c          |   14 ++++++++++++--
>  drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
>  drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
>  include/linux/mfd/tmio.h               |    3 +++
>  include/linux/mmc/host.h               |    1 -
>  8 files changed, 47 insertions(+), 14 deletions(-)
>
>
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

* Re: [PATCH 0/6 v4] mmc: remove MMC_CAP2_NO_MULTI_READ flags
@ 2014-09-09 12:19     ` Ulf Hansson
  0 siblings, 0 replies; 118+ messages in thread
From: Ulf Hansson @ 2014-09-09 12:19 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Simon, Kuninori Morimoto, Linux-SH, linux-mmc, Lee Jones

On 9 September 2014 08:43, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf, Chris, and Simon
>
> These are v4 patches of removing MMC_CAP2_NO_MULTI_READ from mmc.
>
> Simon
> 4) and 5) are for sh-arm patches.
> Can you check these, and give it your Acked-by ?
>
> Kuninori Morimoto (6):
>       1) mmc: use .multi_io_quirk on omap_hsmmc
>       2) mmc: use .multi_io_quirk on tmio_mmc
>       3) mmc: use .multi_io_quirk on sh_mobile
>       4) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from koelsch
>       5) ARM: shmobile: remove MMC_CAP2_NO_MULTI_READ from lager
>       6) mmc: remove MMC_CAP2_NO_MULTI_READ flags

Thanks! Applied for next, with Simon's and Lee's acks.

Kind regards
Uffe

>
>  arch/arm/mach-shmobile/board-koelsch.c |    3 ---
>  arch/arm/mach-shmobile/board-lager.c   |    2 --
>  drivers/mmc/card/block.c               |    5 -----
>  drivers/mmc/host/omap_hsmmc.c          |   14 ++++++++++++--
>  drivers/mmc/host/sh_mobile_sdhi.c      |   20 +++++++++++++++++++-
>  drivers/mmc/host/tmio_mmc_pio.c        |   13 +++++++++++++
>  include/linux/mfd/tmio.h               |    3 +++
>  include/linux/mmc/host.h               |    1 -
>  8 files changed, 47 insertions(+), 14 deletions(-)
>
>
> Best regards
> ---
> Kuninori Morimoto

^ permalink raw reply	[flat|nested] 118+ messages in thread

end of thread, other threads:[~2014-09-09 12:19 UTC | newest]

Thread overview: 118+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01  9:20 [PATCH 0/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-01  9:20 ` Kuninori Morimoto
2014-09-01  9:20 ` [PATCH 1/7] mmc: add blk_size_workaround for HW bug Kuninori Morimoto
2014-09-01  9:20   ` Kuninori Morimoto
2014-09-01  9:21 ` [PATCH 2/7] mmc: omap_hsmmc: use blk_size_workaround Kuninori Morimoto
2014-09-01  9:21   ` Kuninori Morimoto
2014-09-01 10:05   ` Sergei Shtylyov
2014-09-01 10:05     ` Sergei Shtylyov
2014-09-01 23:52     ` Kuninori Morimoto
2014-09-01 23:52       ` Kuninori Morimoto
2014-09-01  9:21 ` [PATCH 3/7] mmc: tmio_mmc: " Kuninori Morimoto
2014-09-01  9:21   ` Kuninori Morimoto
2014-09-01  9:22 ` [PATCH 4/7] mmc: sh_mobile_sdhi: " Kuninori Morimoto
2014-09-01  9:22   ` 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   ` Kuninori Morimoto
2014-09-01  9:22 ` [PATCH 6/7] ARM: shmobile: lager: " Kuninori Morimoto
2014-09-01  9:22   ` Kuninori Morimoto
2014-09-01  9:23 ` [PATCH 7/7] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-01  9:23   ` Kuninori Morimoto
2014-09-02  2:00 ` [PATCH 0/7 v2] " Kuninori Morimoto
2014-09-02  2:00   ` Kuninori Morimoto
2014-09-02  2:01   ` [PATCH 1/7 v2] mmc: add blk_size_workaround for HW bug Kuninori Morimoto
2014-09-02  2:01     ` Kuninori Morimoto
2014-09-02  9:09     ` Ulf Hansson
2014-09-02  9:09       ` Ulf Hansson
2014-09-03  0:44       ` Kuninori Morimoto
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:01     ` Kuninori Morimoto
2014-09-02  2:02   ` [PATCH 3/7 v2] mmc: tmio_mmc: " Kuninori Morimoto
2014-09-02  2:02     ` Kuninori Morimoto
2014-09-02  2:02   ` [PATCH 4/7 v2] mmc: sh_mobile_sdhi: " Kuninori Morimoto
2014-09-02  2:02     ` 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:02     ` Kuninori Morimoto
2014-09-02  2:03   ` [PATCH 6/7 v2] ARM: shmobile: lager: " Kuninori Morimoto
2014-09-02  2:03     ` Kuninori Morimoto
2014-09-02  2:03   ` [PATCH 7/7 v2] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-02  2:03     ` Kuninori Morimoto
2014-09-03  2:08 ` [PATCH 0/7 v3] " Kuninori Morimoto
2014-09-03  2:08   ` 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-03  2:08     ` Kuninori Morimoto
2014-09-08  9:08     ` Ulf Hansson
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-03  2:09     ` Kuninori Morimoto
2014-09-08  9:10     ` Ulf Hansson
2014-09-08  9:10       ` Ulf Hansson
2014-09-09  0:09       ` Kuninori Morimoto
2014-09-09  0:09         ` Kuninori Morimoto
2014-09-09  6:00         ` Ulf Hansson
2014-09-09  6:00           ` Ulf Hansson
2014-09-09  6:07           ` Kuninori Morimoto
2014-09-09  6:07             ` Kuninori Morimoto
2014-09-09  6:36             ` Ulf Hansson
2014-09-09  6:36               ` Ulf Hansson
2014-09-09  6:39               ` Kuninori Morimoto
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-03  2:09     ` Kuninori Morimoto
2014-09-08 10:43     ` Ulf Hansson
2014-09-08 10:43       ` Ulf Hansson
2014-09-08 11:11       ` Lee Jones
2014-09-08 11:11         ` Lee Jones
2014-09-08 11:45         ` Ulf Hansson
2014-09-08 11:45           ` Ulf Hansson
2014-09-09  0:14       ` Kuninori Morimoto
2014-09-09  0:14         ` Kuninori Morimoto
2014-09-09  6:32         ` Ulf Hansson
2014-09-09  6:32           ` Ulf Hansson
2014-09-09  6:33           ` Kuninori Morimoto
2014-09-09  6:33             ` Kuninori Morimoto
2014-09-03  2:09   ` [PATCH 4/7 v3] mmc: use .multi_io_quirk on sh_mobile Kuninori Morimoto
2014-09-03  2:09     ` Kuninori Morimoto
2014-09-08 10:28     ` Ulf Hansson
2014-09-08 10:28       ` Ulf Hansson
2014-09-08 10:53       ` 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     ` 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     ` Kuninori Morimoto
2014-09-03  2:10   ` [PATCH 7/7 v3] mmc: remove MMC_CAP2_NO_MULTI_READ flags Kuninori Morimoto
2014-09-03  2:10     ` Kuninori Morimoto
2014-09-09  2:43   ` [PATCH 0/7 " Simon Horman
2014-09-09  2:43     ` Simon Horman
2014-09-09  2:45     ` Kuninori Morimoto
2014-09-09  2:45       ` Kuninori Morimoto
2014-09-09  3:56       ` Simon Horman
2014-09-09  3:56         ` Simon Horman
2014-09-09  6:43 ` [PATCH 0/6 v4] " Kuninori Morimoto
2014-09-09  6:43   ` 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:44     ` Kuninori Morimoto
2014-09-09  6:45   ` [PATCH 2/6 v4] mmc: use .multi_io_quirk on tmio_mmc Kuninori Morimoto
2014-09-09  6:45     ` Kuninori Morimoto
2014-09-09  7:00     ` Ulf Hansson
2014-09-09  7:00       ` Ulf Hansson
2014-09-09  7:04     ` Kuninori Morimoto
2014-09-09  7:04       ` Kuninori Morimoto
2014-09-09  7:23       ` Lee Jones
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:45     ` 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  6:46     ` Kuninori Morimoto
2014-09-09  8:20     ` Simon Horman
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  6:46     ` Kuninori Morimoto
2014-09-09  8:21     ` Simon Horman
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  6:46     ` Kuninori Morimoto
2014-09-09 12:19   ` [PATCH 0/6 " Ulf Hansson
2014-09-09 12:19     ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.