All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/10][RFC] mmc: tmio: fixup patches
       [not found]       ` <53AD638C.5060907@renesas.com>
@ 2014-07-22  5:30           ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:30 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Morimoto, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp


Hi Chris, Simon

These are fixup patches for mmc tmio/shmobile.
I tesed these patches on my environment.
I'm very happy if someone test these patches.

These patches modify TMIO driver,
but, basically it has no effect to non-Renesas chip.
I CC:ed Ian who created original TMIO driver.

Kuninori Morimoto (3):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()

Shinobu Uehara (6):
      mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
      mmc: block: add block number limitation flag for multiple block read
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 ++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   27 +++++++++++++++++++---
 drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
 drivers/mmc/host/tmio_mmc_pio.c        |   39 +++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
 include/linux/mmc/host.h               |    3 +++
 8 files changed, 110 insertions(+), 18 deletions(-)

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

* [PATCH 0/10][RFC] mmc: tmio: fixup patches
@ 2014-07-22  5:30           ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:30 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Morimoto, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp


Hi Chris, Simon

These are fixup patches for mmc tmio/shmobile.
I tesed these patches on my environment.
I'm very happy if someone test these patches.

These patches modify TMIO driver,
but, basically it has no effect to non-Renesas chip.
I CC:ed Ian who created original TMIO driver.

Kuninori Morimoto (3):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()

Shinobu Uehara (6):
      mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
      mmc: block: add block number limitation flag for multiple block read
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 ++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   27 +++++++++++++++++++---
 drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
 drivers/mmc/host/tmio_mmc_pio.c        |   39 +++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
 include/linux/mmc/host.h               |    3 +++
 8 files changed, 110 insertions(+), 18 deletions(-)

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

* [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:33             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:33 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..18cf462 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -126,6 +126,7 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
 	case CTL_SD_MEM_CARD_OPT:
 	case CTL_TRANSACTION_CTL:
 	case CTL_DMA_ENABLE:
+	case EXT_ACC:
 		return sh_mobile_sdhi_wait_idle(host);
 	}
 
-- 
1.7.9.5


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

* [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
@ 2014-07-22  5:33             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:33 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..18cf462 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -126,6 +126,7 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
 	case CTL_SD_MEM_CARD_OPT:
 	case CTL_TRANSACTION_CTL:
 	case CTL_DMA_ENABLE:
+	case EXT_ACC:
 		return sh_mobile_sdhi_wait_idle(host);
 	}
 
-- 
1.7.9.5


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

* [PATCH 02/10] mmc: block: add block number limitation flag for multiple block read
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

In some 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.
MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ

[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
 include/linux/mmc/host.h               |    3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 2cd3194..4936436 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -333,7 +333,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -346,7 +346,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -359,7 +359,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index b8b2b44..ad85f9d 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -634,7 +634,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -648,7 +648,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..f3cbe37 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 
 		/* 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;
+		    rq_data_dir(req) = READ) {
+
+			if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
+				/*
+				 * In some 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 (brq->data.blocks = 2)
+					brq->data.blocks = 1;
+			} else {
+				brq->data.blocks = 1;
+			}
+		}
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 18cf462..90b1ee2 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..3510fba 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -266,6 +266,9 @@ 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_2BLKS_LIMIT	(1 << 4)	/* 2 blocks limit for multi read */
+#define MMC_CAP2_NO_2BLKS_READ	(MMC_CAP2_NO_MULTI_READ | \
+				 MMC_CAP2_2BLKS_LIMIT)
 #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] 152+ messages in thread

* [PATCH 02/10] mmc: block: add block number limitation flag for multiple block read
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

In some 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.
MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ

[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
 include/linux/mmc/host.h               |    3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 2cd3194..4936436 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -333,7 +333,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -346,7 +346,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -359,7 +359,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index b8b2b44..ad85f9d 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -634,7 +634,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -648,7 +648,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..f3cbe37 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 
 		/* 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;
+		    rq_data_dir(req) == READ) {
+
+			if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
+				/*
+				 * In some 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 (brq->data.blocks == 2)
+					brq->data.blocks = 1;
+			} else {
+				brq->data.blocks = 1;
+			}
+		}
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 18cf462..90b1ee2 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..3510fba 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -266,6 +266,9 @@ 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_2BLKS_LIMIT	(1 << 4)	/* 2 blocks limit for multi read */
+#define MMC_CAP2_NO_2BLKS_READ	(MMC_CAP2_NO_MULTI_READ | \
+				 MMC_CAP2_2BLKS_LIMIT)
 #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] 152+ messages in thread

* [PATCH 03/10] mmc: tmio: care about DMA tx/rx addr offset
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 90b1ee2..c53bd2f 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -229,6 +231,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 03e7b28..1925170 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -311,7 +311,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
 		if (ret < 0)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 03/10] mmc: tmio: care about DMA tx/rx addr offset
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 90b1ee2..c53bd2f 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -229,6 +231,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 03e7b28..1925170 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -311,7 +311,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
 		if (ret < 0)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 04/10] mmc: tmio: clear error IRQ status
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 04/10] mmc: tmio: clear error IRQ status
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 05/10] mmc: tmio: control multiple block transfer mode
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index c53bd2f..7b9c816 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -226,6 +226,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode = SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 05/10] mmc: tmio: control multiple block transfer mode
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index c53bd2f..7b9c816 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -226,6 +226,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode == SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 06/10] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 7b9c816..8b3c6cd 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -231,6 +231,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 06/10] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 7b9c816..8b3c6cd 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -231,6 +231,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 07/10] mmc: tmio: check ILL_FUNC instead of CBSY
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 07/10] mmc: tmio: check ILL_FUNC instead of CBSY
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 08/10] mmc: tmio: remove Renesas specific #ifdef
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:34             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 8b3c6cd..b16f1bb 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -236,6 +236,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 1925170..8b1121e 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 08/10] mmc: tmio: remove Renesas specific #ifdef
@ 2014-07-22  5:34             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:34 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 8b3c6cd..b16f1bb 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -236,6 +236,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 1925170..8b1121e 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 09/10] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:35             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:35 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 09/10] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
@ 2014-07-22  5:35             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:35 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 10/10] mmc: tmio: add actual clock support as option
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-22  5:35             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:35 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0].
Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    6 ++++--
 drivers/mmc/host/tmio_mmc_pio.c   |    5 +++++
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b16f1bb..73fac95 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
+			  TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.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_2BLKS_READ,
 	.dma_rx_offset	= 0x2000,
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..f268ba6 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
+
+		/* 1/1 clock is option */
+		if ((host->pdata->flags & TMIO_MMC_CLK_ACTUAL) &&
+		    ((clk >> 22) & 0x1))
+			clk |= 0xff;
 	}
 
 	if (host->set_clk_div)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index adcb0cd..90436d5 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -99,6 +99,11 @@
  */
 #define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
 
+/*
+ * Some controllers allows to set SDx actual clock
+ */
+#define TMIO_MMC_CLK_ACTUAL		(1 << 10)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 10/10] mmc: tmio: add actual clock support as option
@ 2014-07-22  5:35             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22  5:35 UTC (permalink / raw)
  To: Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0].
Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    6 ++++--
 drivers/mmc/host/tmio_mmc_pio.c   |    5 +++++
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b16f1bb..73fac95 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
+			  TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.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_2BLKS_READ,
 	.dma_rx_offset	= 0x2000,
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..f268ba6 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
+
+		/* 1/1 clock is option */
+		if ((host->pdata->flags & TMIO_MMC_CLK_ACTUAL) &&
+		    ((clk >> 22) & 0x1))
+			clk |= 0xff;
 	}
 
 	if (host->set_clk_div)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index adcb0cd..90436d5 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -99,6 +99,11 @@
  */
 #define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
 
+/*
+ * Some controllers allows to set SDx actual clock
+ */
+#define TMIO_MMC_CLK_ACTUAL		(1 << 10)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* Re: [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
  2014-07-22  5:33             ` Kuninori Morimoto
@ 2014-07-22 12:39               ` Sergei Shtylyov
  -1 siblings, 0 replies; 152+ messages in thread
From: Sergei Shtylyov @ 2014-07-22 12:39 UTC (permalink / raw)
  To: Kuninori Morimoto, Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, (Renesas) goda,
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hello.

On 07/22/2014 09:33 AM, Kuninori Morimoto wrote:

> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

   Morimoto-san, when the patches pass thru you, you need to sign off on them.

WBR, Sergei


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

* Re: [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
@ 2014-07-22 12:39               ` Sergei Shtylyov
  0 siblings, 0 replies; 152+ messages in thread
From: Sergei Shtylyov @ 2014-07-22 12:39 UTC (permalink / raw)
  To: Kuninori Morimoto, Simon, Ian Molton, Chris Ball
  Cc: TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, (Renesas) goda,
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hello.

On 07/22/2014 09:33 AM, Kuninori Morimoto wrote:

> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

   Morimoto-san, when the patches pass thru you, you need to sign off on them.

WBR, Sergei


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

* Re: [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
  2014-07-22 12:39               ` Sergei Shtylyov
@ 2014-07-22 23:51                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22 23:51 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Simon, Ian Molton, Chris Ball, TOSHIAKI KOMATSU, NAOYA SHIIBA,
	Magnus, Linux-SH, (Renesas) goda, linux-mmc, ryo.kataoka.wt,
	shinobu.uehara.xc, kouei.abe.cp


Hi Sergei

> > From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> 
> > Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> 
>    Morimoto-san, when the patches pass thru you, you need to sign off on them.

Ahh... yes indeed.
Thank you for pointing it.
Will fix in v2

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
@ 2014-07-22 23:51                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-22 23:51 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Simon, Ian Molton, Chris Ball, TOSHIAKI KOMATSU, NAOYA SHIIBA,
	Magnus, Linux-SH, (Renesas) goda, linux-mmc, ryo.kataoka.wt,
	shinobu.uehara.xc, kouei.abe.cp


Hi Sergei

> > From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> 
> > Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> 
>    Morimoto-san, when the patches pass thru you, you need to sign off on them.

Ahh... yes indeed.
Thank you for pointing it.
Will fix in v2

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-07-29  8:42             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:42 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep

Hi Chris, Simon

These are v2 of fixup patches for mmc tmio/shmobile.
I tesed these patches on my environment.
I'm very happy if someone test these patches.

Kuninori Morimoto (4):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
      mmc: tmio: ensure that the clock has been stopped before set_clock

Shinobu Uehara (6):
      mmc: block: add block number limitation flag for multiple block read
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
 drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
 drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
 include/linux/mmc/host.h               |    3 +++
 8 files changed, 110 insertions(+), 18 deletions(-)


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-29  8:42             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:42 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep

Hi Chris, Simon

These are v2 of fixup patches for mmc tmio/shmobile.
I tesed these patches on my environment.
I'm very happy if someone test these patches.

Kuninori Morimoto (4):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
      mmc: tmio: ensure that the clock has been stopped before set_clock

Shinobu Uehara (6):
      mmc: block: add block number limitation flag for multiple block read
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
 drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
 drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
 include/linux/mmc/host.h               |    3 +++
 8 files changed, 110 insertions(+), 18 deletions(-)


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

* [PATCH 01/10 v2] mmc: block: add block number limitation flag for multiple block read
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:44               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:44 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

In some 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.
MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ

[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
 include/linux/mmc/host.h               |    3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 2cd3194..4936436 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -333,7 +333,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -346,7 +346,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -359,7 +359,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index b8b2b44..ad85f9d 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -634,7 +634,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -648,7 +648,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..f3cbe37 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 
 		/* 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;
+		    rq_data_dir(req) = READ) {
+
+			if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
+				/*
+				 * In some 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 (brq->data.blocks = 2)
+					brq->data.blocks = 1;
+			} else {
+				brq->data.blocks = 1;
+			}
+		}
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..b3baa83 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..3510fba 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -266,6 +266,9 @@ 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_2BLKS_LIMIT	(1 << 4)	/* 2 blocks limit for multi read */
+#define MMC_CAP2_NO_2BLKS_READ	(MMC_CAP2_NO_MULTI_READ | \
+				 MMC_CAP2_2BLKS_LIMIT)
 #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] 152+ messages in thread

* [PATCH 01/10 v2] mmc: block: add block number limitation flag for multiple block read
@ 2014-07-29  8:44               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:44 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

In some 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.
MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ

[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
 include/linux/mmc/host.h               |    3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 2cd3194..4936436 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -333,7 +333,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -346,7 +346,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -359,7 +359,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index b8b2b44..ad85f9d 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -634,7 +634,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -648,7 +648,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..f3cbe37 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 
 		/* 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;
+		    rq_data_dir(req) == READ) {
+
+			if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
+				/*
+				 * In some 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 (brq->data.blocks == 2)
+					brq->data.blocks = 1;
+			} else {
+				brq->data.blocks = 1;
+			}
+		}
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..b3baa83 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..3510fba 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -266,6 +266,9 @@ 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_2BLKS_LIMIT	(1 << 4)	/* 2 blocks limit for multi read */
+#define MMC_CAP2_NO_2BLKS_READ	(MMC_CAP2_NO_MULTI_READ | \
+				 MMC_CAP2_2BLKS_LIMIT)
 #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] 152+ messages in thread

* [PATCH 02/10 v2] mmc: tmio: care about DMA tx/rx addr offset
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:44               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:44 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b3baa83..91c6399 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 03e7b28..1925170 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -311,7 +311,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
 		if (ret < 0)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 02/10 v2] mmc: tmio: care about DMA tx/rx addr offset
@ 2014-07-29  8:44               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:44 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b3baa83..91c6399 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 03e7b28..1925170 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -311,7 +311,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
 		if (ret < 0)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 03/10 v2] mmc: tmio: clear error IRQ status
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:44               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:44 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 03/10 v2] mmc: tmio: clear error IRQ status
@ 2014-07-29  8:44               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:44 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 04/10 v2] mmc: tmio: control multiple block transfer mode
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:45               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:45 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91c6399..1d54b78 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode = SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 04/10 v2] mmc: tmio: control multiple block transfer mode
@ 2014-07-29  8:45               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:45 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91c6399..1d54b78 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode == SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 05/10 v2] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:45               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:45 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 1d54b78..ad00fb8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 05/10 v2] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
@ 2014-07-29  8:45               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:45 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 1d54b78..ad00fb8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 06/10 v2] mmc: tmio: check ILL_FUNC instead of CBSY
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:46               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:46 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 06/10 v2] mmc: tmio: check ILL_FUNC instead of CBSY
@ 2014-07-29  8:46               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:46 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 07/10 v2] mmc: tmio: remove Renesas specific #ifdef
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:46               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:46 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index ad00fb8..b6f94c8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 1925170..8b1121e 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 07/10 v2] mmc: tmio: remove Renesas specific #ifdef
@ 2014-07-29  8:46               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:46 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index ad00fb8..b6f94c8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 1925170..8b1121e 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 08/10 v2] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:47               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 08/10 v2] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
@ 2014-07-29  8:47               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 09/10 v2] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:47               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..1c5a631 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power = TMIO_MMC_OFF_STOP)
 			tmio_mmc_reset(host);
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		if (host->power = TMIO_MMC_OFF_STOP)
 			/* power up SD card and the bus */
-- 
1.7.9.5


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

* [PATCH 09/10 v2] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-07-29  8:47               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..1c5a631 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power == TMIO_MMC_OFF_STOP)
 			tmio_mmc_reset(host);
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		if (host->power == TMIO_MMC_OFF_STOP)
 			/* power up SD card and the bus */
-- 
1.7.9.5


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

* [PATCH 10/10 v2] mmc: tmio: add actual clock support as option
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-29  8:47               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0].
Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    6 ++++--
 drivers/mmc/host/tmio_mmc_pio.c   |    5 +++++
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b6f94c8..a6bdb83 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
+			  TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.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_2BLKS_READ,
 	.dma_rx_offset	= 0x2000,
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1c5a631..895e713 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
+
+		/* 1/1 clock is option */
+		if ((host->pdata->flags & TMIO_MMC_CLK_ACTUAL) &&
+		    ((clk >> 22) & 0x1))
+			clk |= 0xff;
 	}
 
 	if (host->set_clk_div)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index adcb0cd..90436d5 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -99,6 +99,11 @@
  */
 #define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
 
+/*
+ * Some controllers allows to set SDx actual clock
+ */
+#define TMIO_MMC_CLK_ACTUAL		(1 << 10)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 10/10 v2] mmc: tmio: add actual clock support as option
@ 2014-07-29  8:47               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-29  8:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	goda (Renesas),
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp,
	cm-hiep, Kuninori Morimoto, Kuninori Morimoto

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0].
Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.

[Kuninori Morimoto: tidyuped for upstreaming]

Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    6 ++++--
 drivers/mmc/host/tmio_mmc_pio.c   |    5 +++++
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b6f94c8..a6bdb83 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
+			  TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.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_2BLKS_READ,
 	.dma_rx_offset	= 0x2000,
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1c5a631..895e713 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
+
+		/* 1/1 clock is option */
+		if ((host->pdata->flags & TMIO_MMC_CLK_ACTUAL) &&
+		    ((clk >> 22) & 0x1))
+			clk |= 0xff;
 	}
 
 	if (host->set_clk_div)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index adcb0cd..90436d5 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -99,6 +99,11 @@
  */
 #define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
 
+/*
+ * Some controllers allows to set SDx actual clock
+ */
+#define TMIO_MMC_CLK_ACTUAL		(1 << 10)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-30  0:45               ` Simon Horman
  -1 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-07-30  0:45 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus,
	Linux-SH, goda, linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc,
	kouei.abe.cp, cm-hiep

On Tue, Jul 29, 2014 at 01:42:33AM -0700, Kuninori Morimoto wrote:
> Hi Chris, Simon
> 
> These are v2 of fixup patches for mmc tmio/shmobile.
> I tesed these patches on my environment.
> I'm very happy if someone test these patches.

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

> 
> Kuninori Morimoto (4):
>       mmc: tmio: care about DMA tx/rx addr offset
>       mmc: tmio: remove Renesas specific #ifdef
>       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>       mmc: tmio: ensure that the clock has been stopped before set_clock
> 
> Shinobu Uehara (6):
>       mmc: block: add block number limitation flag for multiple block read
>       mmc: tmio: clear error IRQ status
>       mmc: tmio: control multiple block transfer mode
>       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>       mmc: tmio: check ILL_FUNC instead of CBSY
>       mmc: tmio: add actual clock support as option
> 
>  arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
>  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>  drivers/mmc/card/block.c               |   19 +++++++++++++--
>  drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
>  drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
>  drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
>  include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
>  include/linux/mmc/host.h               |    3 +++
>  8 files changed, 110 insertions(+), 18 deletions(-)
> 

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-30  0:45               ` Simon Horman
  0 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-07-30  0:45 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus,
	Linux-SH, goda, linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc,
	kouei.abe.cp, cm-hiep

On Tue, Jul 29, 2014 at 01:42:33AM -0700, Kuninori Morimoto wrote:
> Hi Chris, Simon
> 
> These are v2 of fixup patches for mmc tmio/shmobile.
> I tesed these patches on my environment.
> I'm very happy if someone test these patches.

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

> 
> Kuninori Morimoto (4):
>       mmc: tmio: care about DMA tx/rx addr offset
>       mmc: tmio: remove Renesas specific #ifdef
>       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>       mmc: tmio: ensure that the clock has been stopped before set_clock
> 
> Shinobu Uehara (6):
>       mmc: block: add block number limitation flag for multiple block read
>       mmc: tmio: clear error IRQ status
>       mmc: tmio: control multiple block transfer mode
>       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>       mmc: tmio: check ILL_FUNC instead of CBSY
>       mmc: tmio: add actual clock support as option
> 
>  arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
>  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>  drivers/mmc/card/block.c               |   19 +++++++++++++--
>  drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
>  drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
>  drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
>  include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
>  include/linux/mmc/host.h               |    3 +++
>  8 files changed, 110 insertions(+), 18 deletions(-)
> 

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-07-31  1:52               ` カオ ミン ヒェップ
  -1 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  1:52 UTC (permalink / raw)
  To: Kuninori Morimoto, Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	(Renesas)goda, linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc,
	kouei.abe.cp

Hi Morimoto-san, Simon-san

On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
> Hi Chris, Simon
>
> These are v2 of fixup patches for mmc tmio/shmobile.
> I tesed these patches on my environment.
> I'm very happy if someone test these patches.
I have just tested these series on Lager. if remove CONFIG_HIGHMEM from 
config file,
They are good at SDHI and MMC on my environment.
> Kuninori Morimoto (4):
>        mmc: tmio: care about DMA tx/rx addr offset
>        mmc: tmio: remove Renesas specific #ifdef
>        mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>        mmc: tmio: ensure that the clock has been stopped before set_clock
>
> Shinobu Uehara (6):
>        mmc: block: add block number limitation flag for multiple block read
>        mmc: tmio: clear error IRQ status
>        mmc: tmio: control multiple block transfer mode
>        mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>        mmc: tmio: check ILL_FUNC instead of CBSY
>        mmc: tmio: add actual clock support as option
>
>   arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
>   arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>   drivers/mmc/card/block.c               |   19 +++++++++++++--
>   drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
>   drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
>   drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
>   include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
>   include/linux/mmc/host.h               |    3 +++
>   8 files changed, 110 insertions(+), 18 deletions(-)
>
>
>

Best regards,
Cao Minh Hiep.


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-31  1:52               ` カオ ミン ヒェップ
  0 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  1:52 UTC (permalink / raw)
  To: Kuninori Morimoto, Simon, Chris Ball
  Cc: Ian Molton, TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH,
	(Renesas)goda, linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc,
	kouei.abe.cp

Hi Morimoto-san, Simon-san

On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
> Hi Chris, Simon
>
> These are v2 of fixup patches for mmc tmio/shmobile.
> I tesed these patches on my environment.
> I'm very happy if someone test these patches.
I have just tested these series on Lager. if remove CONFIG_HIGHMEM from 
config file,
They are good at SDHI and MMC on my environment.
> Kuninori Morimoto (4):
>        mmc: tmio: care about DMA tx/rx addr offset
>        mmc: tmio: remove Renesas specific #ifdef
>        mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>        mmc: tmio: ensure that the clock has been stopped before set_clock
>
> Shinobu Uehara (6):
>        mmc: block: add block number limitation flag for multiple block read
>        mmc: tmio: clear error IRQ status
>        mmc: tmio: control multiple block transfer mode
>        mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>        mmc: tmio: check ILL_FUNC instead of CBSY
>        mmc: tmio: add actual clock support as option
>
>   arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
>   arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>   drivers/mmc/card/block.c               |   19 +++++++++++++--
>   drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
>   drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
>   drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
>   include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
>   include/linux/mmc/host.h               |    3 +++
>   8 files changed, 110 insertions(+), 18 deletions(-)
>
>
>

Best regards,
Cao Minh Hiep.


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-31  1:52               ` カオ ミン ヒェップ
@ 2014-07-31  2:30                 ` Simon Horman
  -1 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-07-31  2:30 UTC (permalink / raw)
  To: カオ ミン ヒェップ
  Cc: Kuninori Morimoto, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hi Hiep-san,

On Thu, Jul 31, 2014 at 10:52:08AM +0900, カオ ミン ヒェップ wrote:
> Hi Morimoto-san, Simon-san
> 
> On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
> >Hi Chris, Simon
> >
> >These are v2 of fixup patches for mmc tmio/shmobile.
> >I tesed these patches on my environment.
> >I'm very happy if someone test these patches.
> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
> config file,
> They are good at SDHI and MMC on my environment.

Could you provided a Tested-by tag?

> >Kuninori Morimoto (4):
> >       mmc: tmio: care about DMA tx/rx addr offset
> >       mmc: tmio: remove Renesas specific #ifdef
> >       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
> >       mmc: tmio: ensure that the clock has been stopped before set_clock
> >
> >Shinobu Uehara (6):
> >       mmc: block: add block number limitation flag for multiple block read
> >       mmc: tmio: clear error IRQ status
> >       mmc: tmio: control multiple block transfer mode
> >       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
> >       mmc: tmio: check ILL_FUNC instead of CBSY
> >       mmc: tmio: add actual clock support as option
> >
> >  arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
> >  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
> >  drivers/mmc/card/block.c               |   19 +++++++++++++--
> >  drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
> >  drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
> >  drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
> >  include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
> >  include/linux/mmc/host.h               |    3 +++
> >  8 files changed, 110 insertions(+), 18 deletions(-)
> >
> >
> >
> 
> Best regards,
> Cao Minh Hiep.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-31  2:30                 ` Simon Horman
  0 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-07-31  2:30 UTC (permalink / raw)
  To: カオ ミン ヒェップ
  Cc: Kuninori Morimoto, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hi Hiep-san,

On Thu, Jul 31, 2014 at 10:52:08AM +0900, カオ ミン ヒェップ wrote:
> Hi Morimoto-san, Simon-san
> 
> On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
> >Hi Chris, Simon
> >
> >These are v2 of fixup patches for mmc tmio/shmobile.
> >I tesed these patches on my environment.
> >I'm very happy if someone test these patches.
> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
> config file,
> They are good at SDHI and MMC on my environment.

Could you provided a Tested-by tag?

> >Kuninori Morimoto (4):
> >       mmc: tmio: care about DMA tx/rx addr offset
> >       mmc: tmio: remove Renesas specific #ifdef
> >       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
> >       mmc: tmio: ensure that the clock has been stopped before set_clock
> >
> >Shinobu Uehara (6):
> >       mmc: block: add block number limitation flag for multiple block read
> >       mmc: tmio: clear error IRQ status
> >       mmc: tmio: control multiple block transfer mode
> >       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
> >       mmc: tmio: check ILL_FUNC instead of CBSY
> >       mmc: tmio: add actual clock support as option
> >
> >  arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
> >  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
> >  drivers/mmc/card/block.c               |   19 +++++++++++++--
> >  drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
> >  drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
> >  drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
> >  include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
> >  include/linux/mmc/host.h               |    3 +++
> >  8 files changed, 110 insertions(+), 18 deletions(-)
> >
> >
> >
> 
> Best regards,
> Cao Minh Hiep.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-31  2:30                 ` Simon Horman
@ 2014-07-31  4:27                   ` カオ ミン ヒェップ
  -1 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  4:27 UTC (permalink / raw)
  To: Simon Horman
  Cc: Kuninori Morimoto, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hi Simon-san

On 07/31/2014 11:30 AM, Simon Horman wrote:
> Hi Hiep-san,
>
> On Thu, Jul 31, 2014 at 10:52:08AM +0900, カオ ミン ヒェップ wrote:
>> Hi Morimoto-san, Simon-san
>>
>> On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
>>> Hi Chris, Simon
>>>
>>> These are v2 of fixup patches for mmc tmio/shmobile.
>>> I tesed these patches on my environment.
>>> I'm very happy if someone test these patches.
>> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
>> config file,
>> They are good at SDHI and MMC on my environment.
> Could you provided a Tested-by tag?
Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>>> Kuninori Morimoto (4):
>>>        mmc: tmio: care about DMA tx/rx addr offset
>>>        mmc: tmio: remove Renesas specific #ifdef
>>>        mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>>>        mmc: tmio: ensure that the clock has been stopped before set_clock
>>>
>>> Shinobu Uehara (6):
>>>        mmc: block: add block number limitation flag for multiple block read
>>>        mmc: tmio: clear error IRQ status
>>>        mmc: tmio: control multiple block transfer mode
>>>        mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>>>        mmc: tmio: check ILL_FUNC instead of CBSY
>>>        mmc: tmio: add actual clock support as option
>>>
>>>   arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
>>>   arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>>>   drivers/mmc/card/block.c               |   19 +++++++++++++--
>>>   drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
>>>   drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
>>>   drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
>>>   include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
>>>   include/linux/mmc/host.h               |    3 +++
>>>   8 files changed, 110 insertions(+), 18 deletions(-)
>>>
>>>
>>>
>> Best regards,
>> Cao Minh Hiep.
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-31  4:27                   ` カオ ミン ヒェップ
  0 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  4:27 UTC (permalink / raw)
  To: Simon Horman
  Cc: Kuninori Morimoto, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hi Simon-san

On 07/31/2014 11:30 AM, Simon Horman wrote:
> Hi Hiep-san,
>
> On Thu, Jul 31, 2014 at 10:52:08AM +0900, カオ ミン ヒェップ wrote:
>> Hi Morimoto-san, Simon-san
>>
>> On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
>>> Hi Chris, Simon
>>>
>>> These are v2 of fixup patches for mmc tmio/shmobile.
>>> I tesed these patches on my environment.
>>> I'm very happy if someone test these patches.
>> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
>> config file,
>> They are good at SDHI and MMC on my environment.
> Could you provided a Tested-by tag?
Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>>> Kuninori Morimoto (4):
>>>        mmc: tmio: care about DMA tx/rx addr offset
>>>        mmc: tmio: remove Renesas specific #ifdef
>>>        mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>>>        mmc: tmio: ensure that the clock has been stopped before set_clock
>>>
>>> Shinobu Uehara (6):
>>>        mmc: block: add block number limitation flag for multiple block read
>>>        mmc: tmio: clear error IRQ status
>>>        mmc: tmio: control multiple block transfer mode
>>>        mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>>>        mmc: tmio: check ILL_FUNC instead of CBSY
>>>        mmc: tmio: add actual clock support as option
>>>
>>>   arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
>>>   arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>>>   drivers/mmc/card/block.c               |   19 +++++++++++++--
>>>   drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
>>>   drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
>>>   drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
>>>   include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
>>>   include/linux/mmc/host.h               |    3 +++
>>>   8 files changed, 110 insertions(+), 18 deletions(-)
>>>
>>>
>>>
>> Best regards,
>> Cao Minh Hiep.
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-31  4:27                   ` カオ ミン ヒェップ
@ 2014-07-31  4:30                     ` Simon Horman
  -1 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-07-31  4:30 UTC (permalink / raw)
  To: カオ ミン ヒェップ
  Cc: Kuninori Morimoto, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

On Thu, Jul 31, 2014 at 01:27:15PM +0900, カオ ミン ヒェップ wrote:
> Hi Simon-san
> 
> On 07/31/2014 11:30 AM, Simon Horman wrote:
> >Hi Hiep-san,
> >
> >On Thu, Jul 31, 2014 at 10:52:08AM +0900, カオ ミン ヒェップ wrote:
> >>Hi Morimoto-san, Simon-san
> >>
> >>On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
> >>>Hi Chris, Simon
> >>>
> >>>These are v2 of fixup patches for mmc tmio/shmobile.
> >>>I tesed these patches on my environment.
> >>>I'm very happy if someone test these patches.
> >>I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
> >>config file,
> >>They are good at SDHI and MMC on my environment.
> >Could you provided a Tested-by tag?
> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>

Thanks.

Chris, would you consider taking this series?

> >>>Kuninori Morimoto (4):
> >>>       mmc: tmio: care about DMA tx/rx addr offset
> >>>       mmc: tmio: remove Renesas specific #ifdef
> >>>       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
> >>>       mmc: tmio: ensure that the clock has been stopped before set_clock
> >>>
> >>>Shinobu Uehara (6):
> >>>       mmc: block: add block number limitation flag for multiple block read
> >>>       mmc: tmio: clear error IRQ status
> >>>       mmc: tmio: control multiple block transfer mode
> >>>       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
> >>>       mmc: tmio: check ILL_FUNC instead of CBSY
> >>>       mmc: tmio: add actual clock support as option
> >>>
> >>>  arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
> >>>  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
> >>>  drivers/mmc/card/block.c               |   19 +++++++++++++--
> >>>  drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
> >>>  drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
> >>>  drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
> >>>  include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
> >>>  include/linux/mmc/host.h               |    3 +++
> >>>  8 files changed, 110 insertions(+), 18 deletions(-)
> >>>
> >>>
> >>>
> >>Best regards,
> >>Cao Minh Hiep.
> >>
> >>--
> >>To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> >>the body of a message to majordomo@vger.kernel.org
> >>More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >>
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> 

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-31  4:30                     ` Simon Horman
  0 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-07-31  4:30 UTC (permalink / raw)
  To: カオ ミン ヒェップ
  Cc: Kuninori Morimoto, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

On Thu, Jul 31, 2014 at 01:27:15PM +0900, カオ ミン ヒェップ wrote:
> Hi Simon-san
> 
> On 07/31/2014 11:30 AM, Simon Horman wrote:
> >Hi Hiep-san,
> >
> >On Thu, Jul 31, 2014 at 10:52:08AM +0900, カオ ミン ヒェップ wrote:
> >>Hi Morimoto-san, Simon-san
> >>
> >>On 07/29/2014 05:42 PM, Kuninori Morimoto wrote:
> >>>Hi Chris, Simon
> >>>
> >>>These are v2 of fixup patches for mmc tmio/shmobile.
> >>>I tesed these patches on my environment.
> >>>I'm very happy if someone test these patches.
> >>I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
> >>config file,
> >>They are good at SDHI and MMC on my environment.
> >Could you provided a Tested-by tag?
> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>

Thanks.

Chris, would you consider taking this series?

> >>>Kuninori Morimoto (4):
> >>>       mmc: tmio: care about DMA tx/rx addr offset
> >>>       mmc: tmio: remove Renesas specific #ifdef
> >>>       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
> >>>       mmc: tmio: ensure that the clock has been stopped before set_clock
> >>>
> >>>Shinobu Uehara (6):
> >>>       mmc: block: add block number limitation flag for multiple block read
> >>>       mmc: tmio: clear error IRQ status
> >>>       mmc: tmio: control multiple block transfer mode
> >>>       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
> >>>       mmc: tmio: check ILL_FUNC instead of CBSY
> >>>       mmc: tmio: add actual clock support as option
> >>>
> >>>  arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
> >>>  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
> >>>  drivers/mmc/card/block.c               |   19 +++++++++++++--
> >>>  drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
> >>>  drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
> >>>  drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
> >>>  include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
> >>>  include/linux/mmc/host.h               |    3 +++
> >>>  8 files changed, 110 insertions(+), 18 deletions(-)
> >>>
> >>>
> >>>
> >>Best regards,
> >>Cao Minh Hiep.
> >>
> >>--
> >>To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> >>the body of a message to majordomo@vger.kernel.org
> >>More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >>
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> 

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-31  4:27                   ` カオ ミン ヒェップ
@ 2014-07-31  4:34                     ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-31  4:34 UTC (permalink / raw)
  To: cm-hiep
  Cc: Simon Horman, Kuninori Morimoto, Chris Ball, Ian Molton,
	TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda,
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp


Hi

> >>> These are v2 of fixup patches for mmc tmio/shmobile.
> >>> I tesed these patches on my environment.
> >>> I'm very happy if someone test these patches.
> >> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
> >> config file,
> >> They are good at SDHI and MMC on my environment.
> > Could you provided a Tested-by tag?
> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>

I guess, both "Tested-by" is correct :)

  Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
  Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>

# "Reported-by" means "bug report", not "test report"

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-31  4:34                     ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-07-31  4:34 UTC (permalink / raw)
  To: cm-hiep
  Cc: Simon Horman, Kuninori Morimoto, Chris Ball, Ian Molton,
	TOSHIAKI KOMATSU, NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda,
	linux-mmc, ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp


Hi

> >>> These are v2 of fixup patches for mmc tmio/shmobile.
> >>> I tesed these patches on my environment.
> >>> I'm very happy if someone test these patches.
> >> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
> >> config file,
> >> They are good at SDHI and MMC on my environment.
> > Could you provided a Tested-by tag?
> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>

I guess, both "Tested-by" is correct :)

  Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
  Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>

# "Reported-by" means "bug report", not "test report"

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
  2014-07-31  4:34                     ` Kuninori Morimoto
@ 2014-07-31  5:05                       ` カオ ミン ヒェップ
  -1 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  5:05 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon Horman, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hi Morimoto-san,

On 07/31/2014 01:34 PM, Kuninori Morimoto wrote:
> Hi
>
>>>>> These are v2 of fixup patches for mmc tmio/shmobile.
>>>>> I tesed these patches on my environment.
>>>>> I'm very happy if someone test these patches.
>>>> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
>>>> config file,
>>>> They are good at SDHI and MMC on my environment.
>>> Could you provided a Tested-by tag?
>> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
>> Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
> I guess, both "Tested-by" is correct :)
>
>    Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
>    Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>
> # "Reported-by" means "bug report", not "test report"
Thanks for pointing it.
Simon-san, Could you please do as Morimoto-san pointed?

Best regards,
Cao Minh Hiep.

> Best regards
> ---
> Kuninori Morimoto
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>


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

* Re: [PATCH 0/10 v2] mmc: tmio: fixup patches
@ 2014-07-31  5:05                       ` カオ ミン ヒェップ
  0 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  5:05 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon Horman, Chris Ball, Ian Molton, TOSHIAKI KOMATSU,
	NAOYA SHIIBA, Magnus, Linux-SH, (Renesas)goda, linux-mmc,
	ryo.kataoka.wt, shinobu.uehara.xc, kouei.abe.cp

Hi Morimoto-san,

On 07/31/2014 01:34 PM, Kuninori Morimoto wrote:
> Hi
>
>>>>> These are v2 of fixup patches for mmc tmio/shmobile.
>>>>> I tesed these patches on my environment.
>>>>> I'm very happy if someone test these patches.
>>>> I have just tested these series on Lager. if remove CONFIG_HIGHMEM from
>>>> config file,
>>>> They are good at SDHI and MMC on my environment.
>>> Could you provided a Tested-by tag?
>> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
>> Reported-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
> I guess, both "Tested-by" is correct :)
>
>    Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
>    Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>
> # "Reported-by" means "bug report", not "test report"
Thanks for pointing it.
Simon-san, Could you please do as Morimoto-san pointed?

Best regards,
Cao Minh Hiep.

> Best regards
> ---
> Kuninori Morimoto
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>


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

* [Bug] mmc: MMC and SDHI has a kernel panic error when transfer data.
  2014-07-29  8:44               ` Kuninori Morimoto
@ 2014-07-31  6:14                 ` カオ ミン ヒェップ
  -1 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  6:14 UTC (permalink / raw)
  To: Simon, Magnus
  Cc: Kuninori Morimoto, Linux-SH, (Renesas)goda, linux-mmc,
	Kuninori Morimoto, S開12/坂戸SC

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

Hi Magnus, Simon

I tested SDHI and MMCIF at Linux-upstream-v3.16-rc5 on Lager.
When I tried to read/write a 100MB or 350MB of data, kernel panic occurs.
I find out that error relates to HIGHMEM the commit "667d0f7 ARM: shmobile:
Enable HIGHMEM in shmobile_defconfig". Because, when I remove 
CONFIG_HIGHMEM
from config file, SDHI and MMCIF does not occur kernel panic error any more.

commit 667d0f7b0e940bf36e8d12bd7d64aa0f9217b3ac
Author: Magnus Damm<damm@opensource.se>
Date:   Wed Apr 2 18:06:24 2014 +0900

     ARM: shmobile: Enable HIGHMEM in shmobile_defconfig
     
     Many mach-shmobile hardware platforms include support for more
     than 1GiB of RAM. Enable HIGHMEM by default to allow use of
     larger amounts of memory.
     
     Signed-off-by: Magnus Damm<damm@opensource.se>
     Signed-off-by: Simon Horman<horms+renesas@verge.net.au>

I attach error log of SDHI and MMCIF and boot_log file.
So, Please fix this bug when you have time.


Best regards,
Cao Minh Hiep


[-- Attachment #2: boot_log.txt --]
[-- Type: text/plain, Size: 11159 bytes --]

root@linaro-nano:~# dmesg
Booting Linux on physical CPU 0x0
Linux version 3.16.0-rc5 (jinso@jinso-OptiPlex-980) (gcc version 4.8.3 20140401 (prereleas4
CPU: ARMv7 Processor [413fc0f2] revision 2 (ARMv7), cr=10c5347d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Ignoring memory block 0x180000000 - 0x200000000
Machine model: Lager
debug: ignoring loglevel setting.
Memory policy: Data cache writealloc
On node 0 totalpages: 524288
free_area_init_node: node 0, pgdat c0603b00, node_mem_map ee7f9000
  Normal zone: 1520 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 194560 pages, LIFO batch:31
  HighMem zone: 2576 pages used for memmap
  HighMem zone: 329728 pages, LIFO batch:31
PERCPU: Embedded 5 pages/cpu @ee79e000 s6912 r0 d13568 u32768
pcpu-alloc: s6912 r0 d13568 u32768 alloc=8*4096
pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 522768
Kernel command line: console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 2073328K/2097152K available (4615K kernel code, 196K rwdata, 1068K rodata, 242K in)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
      .text : 0xc0008000 - 0xc0595f8c   (5688 kB)
      .init : 0xc0596000 - 0xc05d2b00   ( 243 kB)
      .data : 0xc05d4000 - 0xc0605280   ( 197 kB)
       .bss : 0xc0605288 - 0xc0636bf4   ( 199 kB)
Hierarchical RCU implementation.
NR_IRQS:16 nr_irqs:16 16
Architected cp15 timer(s) running at 10.00MHz (virt).
sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 3435973836800ns
Switching to timer-based delay loop
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS )
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: update cpu_capacity 1535
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x40489258 - 0x404892b0
CPU1: Booted secondary processor
CPU1: update cpu_capacity 1535
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU2: Booted secondary processor
CPU2: update cpu_capacity 1535
CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
CPU3: Booted secondary processor
CPU3: update cpu_capacity 1535
CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
CPU4: failed to boot: -22
CPU5: failed to boot: -22
CPU6: failed to boot: -22
CPU7: failed to boot: -22
Brought up 4 CPUs
SMP: Total of 4 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
pinctrl core: initialized pinctrl subsystem
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
renesas_irqc e61c0000.interrupt-controller: driving 4 irqs
sh-pfc e6060000.pfc: r8a77900_pfc support registered
No ATAGs?
hw-breakpoint: Failed to enable monitor mode on CPU 1.
fixed-3.3V: 3300 mV 
platform regulator@1: Driver reg-fixed-voltage requests probe deferral
platform regulator@3: Driver reg-fixed-voltage requests probe deferral
gpio-regulator regulator@2: Could not obtain regulator setting GPIOs: -517
platform regulator@2: Driver gpio-regulator requests probe deferral
gpio-regulator regulator@4: Could not obtain regulator setting GPIOs: -517
platform regulator@4: Driver gpio-regulator requests probe deferral
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
sh_cmt sh-cmt-48-gen2.0: ch0: used for clock events
sh_cmt sh-cmt-48-gen2.0: ch1: used as clock source
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
futex hash table entries: 2048 (order: 5, 131072 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
msgmni has been set to 1473
bounce: pool size: 64 pages
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
gpio_rcar e6050000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6050000.gpio: driving 32 GPIOs
gpio_rcar e6051000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6051000.gpio: driving 32 GPIOs
gpio_rcar e6052000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6052000.gpio: driving 32 GPIOs
gpio_rcar e6053000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6053000.gpio: driving 32 GPIOs
gpio_rcar e6054000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6054000.gpio: driving 32 GPIOs
gpio_rcar e6055000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6055000.gpio: driving 32 GPIOs
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
SuperH (H)SCI(F) driver initialized
sh-sci e6e60000.serial: Runtime PM disabled, clock forced on.
e6e60000.serial: ttySC6 at MMIO 0xe6e60000 (irq = 184, base_baud = 0) is a scif
console [ttySC6] enabled
sh-sci e6e68000.serial: Runtime PM disabled, clock forced on.
e6e68000.serial: ttySC7 at MMIO 0xe6e68000 (irq = 185, base_baud = 0) is a scif
[drm] Initialized drm 1.1.0 20060810
rcar-du rcar-du-r8a7790: fb0:  frame buffer device
rcar-du rcar-du-r8a7790: registered panic notifier
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
[drm] Initialized rcar-du 1.0.0 20130110 on minor 0
sata_rcar ee500000.sata: Runtime PM disabled, clock forced on.
scsi0 : sata_rcar
ata1: SATA max UDMA/133 irq 138
renesas_spi e6b10000.spi: Runtime PM disabled, clock forced on.
m25p80 spi0.0: s25fl512s (65536 Kbytes)
3 ofpart partitions found on MTD device spi0.0
Creating 3 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "loader"
0x000000040000-0x000000440000 : "user"
0x000000440000-0x000004000000 : "flash"
renesas_spi e6b10000.spi: probed
spi_sh_msiof e6e10000.spi: Runtime PM disabled, clock forced on.
sh-eth ee700000.ethernet: Runtime PM disabled, clock forced on.
libphy: sh_mii: probed
sh-eth ee700000.ethernet eth0: Base address at 0xee700000, 2e:09:0a:00:6e:bc, IRQ 194.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
mousedev: PS/2 mouse device common for all mice
rcar_thermal e61f0000.thermal: Runtime PM disabled, clock forced on.
rcar_thermal e61f0000.thermal: 1 sensor probed
sh_mobile_sdhi ee100000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee100000.sd: Got CD GPIO #902.
platform ee100000.sd: Driver sh_mobile_sdhi requests probe deferral
sh_mobile_sdhi ee140000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee140000.sd: Got CD GPIO #918.
platform ee140000.sd: Driver sh_mobile_sdhi requests probe deferral
sh_mmcif ee220000.mmc: Runtime PM disabled, clock forced on.
sh_mmcif ee220000.mmc: No vqmmc regulator found
of_dma_request_slave_channel: dma-names property of node '/mmc@ee220000' missing or empty
sh_mmcif ee220000.mmc: driver version 2010-04-28
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
SDHI0 Vcc: 3300 mV 
SDHI2 Vcc: 3300 mV 
SDHI0 VccQ: 1800 <--> 3300 mV at 3300 mV 
SDHI2 VccQ: 1800 <--> 3300 mV at 3300 mV 
sh_mobile_sdhi ee100000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee100000.sd: Got CD GPIO #902.
of_dma_request_slave_channel: dma-names property of node '/sd@ee100000' missing or empty
sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 clock rate 97 MHz
sh_mobile_sdhi ee140000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee140000.sd: Got CD GPIO #918.
ata1: link resume succeeded after 1 retries
of_dma_request_slave_channel: dma-names property of node '/sd@ee140000' missing or empty
ata1: SATA link down (SStatus 0 SControl 300)
sh_mobile_sdhi ee140000.sd: mmc2 base at 0xee140000 clock rate 48 MHz
input: gpio_keys as /devices/gpio_keys/input/input0
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
mmc0: BKOPS_EN bit is not set
mmc0: new high speed MMC card at address 0001
mmcblk0: mmc0:0001 MMC08G 7.32 GiB 
mmcblk0boot0: mmc0:0001 MMC08G partition 1 2.00 MiB
mmcblk0boot1: mmc0:0001 MMC08G partition 2 2.00 MiB
 mmcblk0: p1 p2
 mmcblk0boot1: unknown partition table
 mmcblk0boot0: unknown partition table
sh-eth ee700000.ethernet eth0: attached PHY 1 (IRQ 416) to driver Micrel KSZ8041RNLI
Sending DHCP requests ..
sh-eth ee700000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
., OK
IP-Config: Got DHCP answer from 172.16.1.27, my address is 172.16.1.35
IP-Config: Complete:
     device=eth0, hwaddr=2e:09:0a:00:6e:bc, ipaddr=172.16.1.35, mask=255.255.255.0, gw=1727
     host=172.16.1.35, domain=, nis-domain=(none)
     bootserver=172.16.1.27, rootserver=172.16.1.27, rootpath=
     nameserver0=172.16.1.27
SDHI2 VccQ: disabling
SDHI0 VccQ: disabling
SDHI2 Vcc: disabling
SDHI0 Vcc: disabling
ALSA device list:
  No soundcards found.
VFS: Mounted root (nfs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 240K (c0596000 - c05d2000)
random: init urandom read with 65 bits of entropy available
random: nonblocking pool is initialized
systemd-udevd[657]: starting version 204
CPU4: failed to boot: -22
CPU5: failed to boot: -22
CPU6: failed to boot: -22
CPU7: failed to boot: -22
init: plymouth main process (571) killed by ABRT signal
init: plymouth-splash main process (962) terminated with status 2
init: failsafe main process (1014) killed by TERM signal
init: plymouth-stop pre-start process (1129) terminated with status 1
init: tty1 main process (1131) killed by TERM signal


[-- Attachment #3: mmc_test-error-log_20140718.txt --]
[-- Type: text/plain, Size: 8040 bytes --]

root@linaro-nano:~# mount /dev/mmcblk0p1 /mnt/eMMC/
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p1): using internal journal
EXT3-fs (mmcblk0p1): recovery complete
EXT3-fs (mmcblk0p1): mounted filesystem with ordered data mode
root@linaro-nano:~# mount -t tmpfs -o size=400m tmpfs /tmp/
root@linaro-nano:~# dd if=/dev/urandom of=/tmp/file-100mb bs=1M count=10

10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 3.29865 s, 3.2 MB/s
root@linaro-nano:~# 
root@linaro-nano:~# cp /tmp/file-100mb /mnt/eMMC/
root@linaro-nano:~# cUnable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 17 [#1] SMP ARM
CPU: 1 PID: 494 Comm: irq/202-ee22000 Not tainted 3.16.0-rc5 #1
task: ed972040 ti: ee3b8000 task.ti: ee3b8000
PC is at sh_mmcif_irqt+0x944/0xc18
LR is at sh_mmcif_irqt+0x30/0xc18
pc : [<c0355638>]    lr : [<c0354d24>]    psr: 80070013
sp : ee3b9ea8  ip : ee3b9ea8  fp : ee3b9efc
r10: 00000001  r9 : c005f688  r8 : ee3b8000
r7 : ee2eade0  r6 : ed8610f8  r5 : ed861034  r4 : edb76680
r3 : 00000000  r2 : 00000200  r1 : 00000000  r0 : edb766f8
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5347d  Table: 6d16806a  DAC: 00000015
Process irq/202-ee22000 (pid: 494, stack limit = 0xee3b8240)
Stack: (0xee3b9ea8 to 0xee3ba000)
9ea0:                   00000000 c005f688 00000000 ee010a74 60070013 00000001
9ec0: 00000003 edb766b4 c005f688 edb766f8 ee3b9f0c ee2eadc0 ee2eadc0 ee010a00
9ee0: ee2eade0 ee3b8000 c005f688 00000001 ee3b9f1c ee3b9f00 c005f6ac c0354d00
9f00: 00000004 ee010a00 ee2eadc0 ee3b8020 ee3b9f5c ee3b9f20 c005f990 c005f694
9f20: c0055b6c 00000000 00000000 c005f7e4 c005f898 ee2ead80 00000000 ee2eadc0
9f40: c005f898 00000000 00000000 00000000 ee3b9fac ee3b9f60 c003f5a0 c005f8a4
9f60: ee3b9f60 00000000 00000000 ee2eadc0 00000000 00000000 ee3b9f78 ee3b9f78
9f80: 00000000 00000000 ee3b9f88 ee3b9f88 ee2ead80 c003f4b0 00000000 00000000
9fa0: 00000000 ee3b9fb0 c000e958 c003f4bc 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
Backtrace: 
[<c0354cf4>] (sh_mmcif_irqt) from [<c005f6ac>] (irq_thread_fn+0x24/0x3c)
 r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee2eade0 r6:ee010a00 r5:ee2eadc0
 r4:ee2eadc0
[<c005f688>] (irq_thread_fn) from [<c005f990>] (irq_thread+0xf8/0x174)
 r6:ee3b8020 r5:ee2eadc0 r4:ee010a00 r3:00000004
[<c005f898>] (irq_thread) from [<c003f5a0>] (kthread+0xf0/0x104)
 r10:00000000 r9:00000000 r8:00000000 r7:c005f898 r6:ee2eadc0 r5:00000000
 r4:ee2ead80
[<c003f4b0>] (kthread) from [<c000e958>] (ret_from_fork+0x14/0x3c)
 r7:00000000 r6:00000000 r5:c003f4b0 r4:ee2ead80
Code: e7f001f2 e5942068 e1530122 2a000004 (e4910004) 
---[ end trace 00854a296d6158ad ]---
Unable to handle kernel paging request at virtual address ffffffec
pgd = c0004000
[ffffffec] *pgd=6f7fd821, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2] SMP ARM
CPU: 1 PID: 494 Comm: irq/202-ee22000 Tainted: G      D       3.16.0-rc5 #1
task: ed972040 ti: ee3b8000 task.ti: ee3b8000
PC is at kthread_data+0x10/0x18
LR is at irq_thread_dtor+0x58/0xb4
pc : [<c003f748>]    lr : [<c005f83c>]    psr: 20070113
sp : ee3b9c00  ip : ee3b9c10  fp : ee3b9c0c
r10: c0355638  r9 : 00000001  r8 : ee3b9c60
r7 : ee3b8008  r6 : c0600a68  r5 : ed972040  r4 : ed972040
r3 : 00000000  r2 : ee3b9c10  r1 : ee3b9f28  r0 : ed972040
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5347d  Table: 6d16806a  DAC: 00000015
Process irq/202-ee22000 (pid: 494, stack limit = 0xee3b8240)
Stack: (0xee3b9c00 to 0xee3ba000)
9c00: ee3b9c24 ee3b9c10 c005f83c c003f744 ed972040 00000000 ee3b9c44 ee3b9c28
9c20: c003d014 c005f7f0 00000000 ed972040 00000000 c035563a ee3b9c7c ee3b9c48
9c40: c0026cc4 c003cf68 c0024bc4 c05de72c ee3b9e60 0000000b c035563a ee3b8000
9c60: ee3b9c7c ee3b9c70 c0024c88 ee3b8000 ee3b9cfc ee3b9c80 c00120bc c0026934
9c80: ee3b8240 0000000b 00000000 60070113 00000008 00000000 65000000 30306637
9ca0: 20326631 34393565 38363032 35316520 32313033 61322032 30303030 28203430
9cc0: 31393465 34303030 c0002029 c047faa0 c054045e 00000000 00000017 00000000
9ce0: ee3b9e60 ed972040 00000000 00000017 ee3b9d14 ee3b9d00 c047f3e4 c0011e08
9d00: ee3b9e60 ee3b9e60 ee3b9db4 ee3b9d18 c001a358 c047f394 00000000 00000001
9d20: c006eb28 00000001 ed411c38 ee7a7440 c05cd440 00000001 c05d6714 c05d009c
9d40: 00000100 c05cd440 ee3b9d8c ee3b9d58 c0050f58 c0050cb0 c002ede8 c048564c
9d60: ee3b9d60 00000020 ee3b8010 ee3b8000 c05d0088 c05d009c 00000000 ee3b8010
9d80: ee3b9ddc ee3b9d90 c002893c 00000017 c05db210 00000000 ee3b9e60 ee3b8000
9da0: c005f688 00000001 ee3b9e5c ee3b9db8 c00091d8 c001a054 ee7a7440 ee3b8000
9dc0: c05ccaf4 00000000 ee3b9e6c 00000064 ee7a7440 ed9720f0 ee7a74f0 c05d6714
9de0: 00000000 ee7a7440 ee3b9e24 ee3b9df8 c0052fac c0051f94 c05cd440 ed972040
9e00: ee3b9e2c ee3b9e10 c002e8dc c04855f4 edb766c4 ee2eadc0 ee3b9e6c ee3b9e28
9e20: c003a36c c0037894 c002f58c c0485700 c0042dcc a0070093 edb766b4 ee2eadc0
9e40: c0355638 80070013 ffffffff ee3b9e94 ee3b9efc ee3b9e60 c0012958 c00091a8
9e60: edb766f8 00000000 00000200 00000000 edb76680 ed861034 ed8610f8 ee2eade0
9e80: ee3b8000 c005f688 00000001 ee3b9efc ee3b9ea8 ee3b9ea8 c0354d24 c0355638
9ea0: 80070013 ffffffff 00000000 c005f688 00000000 ee010a74 60070013 00000001
9ec0: 00000003 edb766b4 c005f688 edb766f8 ee3b9f0c ee2eadc0 ee2eadc0 ee010a00
9ee0: ee2eade0 ee3b8000 c005f688 00000001 ee3b9f1c ee3b9f00 c005f6ac c0354d00
9f00: 00000004 ee010a00 ee2eadc0 ee3b8020 ee3b9f5c ee3b9f20 c005f990 c005f694
9f20: c0055b6c 00000000 00000000 c005f7e4 c005f898 ee2ead80 00000000 ee2eadc0
9f40: c005f898 00000000 00000000 00000000 ee3b9fac ee3b9f60 c003f5a0 c005f8a4
9f60: ee3b9f60 00000000 00000000 ee2eadc0 00000000 00000000 ee3b9f78 ee3b9f78
9f80: 00000001 00010001 ee3b9f88 ee3b9f88 ee2ead80 c003f4b0 00000000 00000000
9fa0: 00000000 ee3b9fb0 c000e958 c003f4bc 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
Backtrace: 
[<c003f738>] (kthread_data) from [<c005f83c>] (irq_thread_dtor+0x58/0xb4)
[<c005f7e4>] (irq_thread_dtor) from [<c003d014>] (task_work_run+0xb8/0xd0)
 r5:00000000 r4:ed972040
[<c003cf5c>] (task_work_run) from [<c0026cc4>] (do_exit+0x39c/0x884)
 r6:c035563a r5:00000000 r4:ed972040 r3:00000000
[<c0026928>] (do_exit) from [<c00120bc>] (die+0x2c0/0x3c4)
 r7:ee3b8000
[<c0011dfc>] (die) from [<c047f3e4>] (__do_kernel_fault.part.11+0x5c/0x7c)
 r10:00000017 r9:00000000 r8:ed972040 r7:ee3b9e60 r6:00000000 r5:00000017
 r4:00000000
[<c047f388>] (__do_kernel_fault.part.11) from [<c001a358>] (do_page_fault+0x310/0x370)
 r7:ee3b9e60 r3:ee3b9e60
[<c001a048>] (do_page_fault) from [<c00091d8>] (do_DataAbort+0x3c/0xa0)
 r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee3b9e60 r6:00000000 r5:c05db210
 r4:00000017
[<c000919c>] (do_DataAbort) from [<c0012958>] (__dabt_svc+0x38/0x60)
Exception stack(0xee3b9e60 to 0xee3b9ea8)
9e60: edb766f8 00000000 00000200 00000000 edb76680 ed861034 ed8610f8 ee2eade0
9e80: ee3b8000 c005f688 00000001 ee3b9efc ee3b9ea8 ee3b9ea8 c0354d24 c0355638
9ea0: 80070013 ffffffff
 r7:ee3b9e94 r6:ffffffff r5:80070013 r4:c0355638
[<c0354cf4>] (sh_mmcif_irqt) from [<c005f6ac>] (irq_thread_fn+0x24/0x3c)
 r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee2eade0 r6:ee010a00 r5:ee2eadc0
 r4:ee2eadc0
[<c005f688>] (irq_thread_fn) from [<c005f990>] (irq_thread+0xf8/0x174)
 r6:ee3b8020 r5:ee2eadc0 r4:ee010a00 r3:00000004
[<c005f898>] (irq_thread) from [<c003f5a0>] (kthread+0xf0/0x104)
 r10:00000000 r9:00000000 r8:00000000 r7:c005f898 r6:ee2eadc0 r5:00000000
 r4:ee2ead80
[<c003f4b0>] (kthread) from [<c000e958>] (ret_from_fork+0x14/0x3c)
 r7:00000000 r6:00000000 r5:c003f4b0 r4:ee2ead80
Code: e1a0c00d e92dd800 e24cb004 e5903238 (e5130014) 
---[ end trace 00854a296d6158ae ]---
Fixing recursive fault but reboot is needed!

[-- Attachment #4: sdhi_test_error_log_20140718.txt --]
[-- Type: text/plain, Size: 7784 bytes --]

root@linaro-nano:~# mount -t tmpfs -o size=400m tmpfs /tmp/
root@linaro-nano:~# dd if=/dev/urandom of=/tmp/file-100mb bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 32.9928 s, 3.2 MB/s
root@linaro-nano:~# mount /dev/mmcblk1p1 /mnt/sd1/
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk1p1): using internal journal
EXT3-fs (mmcblk1p1): mounted filesystem with ordered data mode
root@linaro-nano:~# sync; echo 3 > /proc/sys/vm/drop_caches
bash (1177): drop_caches: 3
root@linaro-nano:~# cp /tmp/file-100mb /mnt/sd1/
Unable to handle kernel paging request at virtual address ffc03000
pgd = c0004000
[ffc03000] *pgd=6f7fa811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1] SMP ARM
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.0-rc5 #2
task: c05df418 ti: c05d4000 task.ti: c05d4000
PC is at __raw_writesw+0x1c/0xe4
LR is at __tmio_mmc_sdcard_irq+0x270/0x42c
pc : [<c047d5bc>]    lr : [<c0355de8>]    psr: 200f0193
sp : c05d5e2c  ip : 00000000  fp : c05d5e5c
r10: c06050f3  r9 : ee0107c0  r8 : 00000200
r7 : ffc00000  r6 : ed01a610  r5 : a00f0193  r4 : ed9e5a80
r3 : 00000000  r2 : 000000f8  r1 : ffc03000  r0 : f00bc030
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5347d  Table: 69a7c06a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0xc05d4240)
Stack: (0xc05d5e2c to 0xc05d6000)
5e20:                            ed9e5a80 a00f0193 c0355de8 02000000 ed9e5a80
5e40: 000000c7 00000000 00000000 ef7fcc40 c05d5e7c c05d5e60 c035615c c0355b84
5e60: 02000000 42800700 ed9e6d00 000000c7 c05d5eb4 c05d5e80 c005f174 c035611c
5e80: c0070fac c0047f94 ee7a01c0 ee0107c0 c05ebf04 00000000 c05d5f74 ef7fcc40
5ea0: 413fc0f2 00000000 c05d5ecc c05d5eb8 c005f2b4 c005f148 ee0107c0 c05ebf04
5ec0: c05d5ee4 c05d5ed0 c0062058 c005f278 000000c7 c05d1af4 c05d5efc c05d5ee8
5ee0: c005eb9c c0061fa8 000001a7 000000c7 c05d5f1c c05d5f00 c000f184 c005eb80
5f00: 000001a0 f0002000 c05d5f40 c05dc88c c05d5f3c c05d5f20 c0009320 c000f120
5f20: c000f484 c000f488 600f0013 ffffffff c05d5f94 c05d5f40 c00129c0 c00092e8
5f40: ee79e420 00000000 0011f146 00000000 c05d4018 c05d4000 c05d4000 c05c7dc0
5f60: ef7fcc40 413fc0f2 00000000 c05d5f94 c05d5f98 c05d5f88 c000f484 c000f488
5f80: 600f0013 ffffffff c05d5fa4 c05d5f98 c00562c0 c000f468 c05d5fb4 c05d5fa8
5fa0: c0480d0c c00561d8 c05d5ff4 c05d5fb8 c0596b74 c0480cb0 ffffffff ffffffff
5fc0: c0596644 00000000 00000000 c05c7dc0 00000000 c0605654 c05dc40c c05c7dbc
5fe0: c05e0498 4000406a 00000000 c05d5ff8 40008074 c05968b4 00000000 00000000
Backtrace: 
[<c0355b78>] (__tmio_mmc_sdcard_irq) from [<c035615c>] (tmio_mmc_irq+0x4c/0x6c)
 r8:ef7fcc40 r7:00000000 r6:00000000 r5:000000c7 r4:ed9e5a80 r3:02000000
[<c0356110>] (tmio_mmc_irq) from [<c005f174>] (handle_irq_event_percpu+0x38/0x130)
 r5:000000c7 r4:ed9e6d00
[<c005f13c>] (handle_irq_event_percpu) from [<c005f2b4>] (handle_irq_event+0x48/0x68)
 r10:00000000 r9:413fc0f2 r8:ef7fcc40 r7:c05d5f74 r6:00000000 r5:c05ebf04
 r4:ee0107c0
[<c005f26c>] (handle_irq_event) from [<c0062058>] (handle_fasteoi_irq+0xbc/0x144)
 r5:c05ebf04 r4:ee0107c0
[<c0061f9c>] (handle_fasteoi_irq) from [<c005eb9c>] (generic_handle_irq+0x28/0x38)
 r5:c05d1af4 r4:000000c7
[<c005eb74>] (generic_handle_irq) from [<c000f184>] (handle_IRQ+0x70/0x98)
 r4:000000c7 r3:000001a7
[<c000f114>] (handle_IRQ) from [<c0009320>] (gic_handle_irq+0x44/0x68)
 r6:c05dc88c r5:c05d5f40 r4:f0002000 r3:000001a0
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xc05d5f40 to 0xc05d5f88)
5f40: ee79e420 00000000 0011f146 00000000 c05d4018 c05d4000 c05d4000 c05c7dc0
5f60: ef7fcc40 413fc0f2 00000000 c05d5f94 c05d5f98 c05d5f88 c000f484 c000f488
5f80: 600f0013 ffffffff
 r6:ffffffff r5:600f0013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c0480d0c>] (rest_init+0x68/0x80)
[<c0480ca4>] (rest_init) from [<c0596b74>] (start_kernel+0x2cc/0x31c)
[<c05968a8>] (start_kernel) from [<40008074>] (0x40008074)
Code: 1afffff6 e92d4030 e2522008 4a00000e (e8b11038) 
---[ end trace b95a7313963532bd ]---
Kernel panic - not syncing: Fatal exception in interrupt
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D       3.16.0-rc5 #2
Backtrace: 
[<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c)
 r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040
[<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98)
[<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c)
 r4:00000001 r3:600f0193
[<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68)
 r6:c05dc88c r5:ee09bf78 r4:f0002000 r3:00000005
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xee09bf78 to 0xee09bfc0)
bf60:                                                       ee7a6420 00000000
bf80: 0000542e 00000000 ee09a010 ee09a000 ee09a000 c06056cc 4000406a 413fc0f2
bfa0: 00000000 ee09bfcc ee09bfd0 ee09bfc0 c000f484 c000f488 600f0013 ffffffff
 r6:ffffffff r5:600f0013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140)
[<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4)
 r4:6e06406a r3:c00093cc
CPU3: stopping
CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D       3.16.0-rc5 #2
Backtrace: 
[<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c)
 r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040
[<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98)
[<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c)
 r4:00000003 r3:60070193
[<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68)
 r6:c05dc88c r5:ee09ff78 r4:f0002000 r3:00000005
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xee09ff78 to 0xee09ffc0)
ff60:                                                       ee7b6420 00000000
ff80: 000037ec 00000000 ee09e010 ee09e000 ee09e000 c06056cc 4000406a 413fc0f2
ffa0: 00000000 ee09ffcc ee09ffd0 ee09ffc0 c000f484 c000f488 60070013 ffffffff
 r6:ffffffff r5:60070013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140)
[<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4)
 r4:6e06406a r3:c00093cc
CPU2: stopping
CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D       3.16.0-rc5 #2
Backtrace: 
[<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c)
 r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040
[<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98)
[<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c)
 r4:00000002 r3:60070193
[<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68)
 r6:c05dc88c r5:ee09df78 r4:f0002000 r3:00000005
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xee09df78 to 0xee09dfc0)
df60:                                                       ee7ae420 00000000
df80: 00003e08 00000000 ee09c010 ee09c000 ee09c000 c06056cc 4000406a 413fc0f2
dfa0: 00000000 ee09dfcc ee09dfd0 ee09dfc0 c000f484 c000f488 60070013 ffffffff
 r6:ffffffff r5:60070013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140)
[<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4)
 r4:6e06406a r3:c00093cc
drm_kms_helper: panic occurred, switching back to text console
---[ end Kernel panic - not syncing: Fatal exception in interrupt

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

* [Bug] mmc: MMC and SDHI has a kernel panic error when transfer data.
@ 2014-07-31  6:14                 ` カオ ミン ヒェップ
  0 siblings, 0 replies; 152+ messages in thread
From: カオ ミン ヒェップ @ 2014-07-31  6:14 UTC (permalink / raw)
  To: Simon, Magnus
  Cc: Kuninori Morimoto, Linux-SH, (Renesas)goda, linux-mmc,
	Kuninori Morimoto, S開12/坂戸SC

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

Hi Magnus, Simon

I tested SDHI and MMCIF at Linux-upstream-v3.16-rc5 on Lager.
When I tried to read/write a 100MB or 350MB of data, kernel panic occurs.
I find out that error relates to HIGHMEM the commit "667d0f7 ARM: shmobile:
Enable HIGHMEM in shmobile_defconfig". Because, when I remove 
CONFIG_HIGHMEM
from config file, SDHI and MMCIF does not occur kernel panic error any more.

commit 667d0f7b0e940bf36e8d12bd7d64aa0f9217b3ac
Author: Magnus Damm<damm@opensource.se>
Date:   Wed Apr 2 18:06:24 2014 +0900

     ARM: shmobile: Enable HIGHMEM in shmobile_defconfig
     
     Many mach-shmobile hardware platforms include support for more
     than 1GiB of RAM. Enable HIGHMEM by default to allow use of
     larger amounts of memory.
     
     Signed-off-by: Magnus Damm<damm@opensource.se>
     Signed-off-by: Simon Horman<horms+renesas@verge.net.au>

I attach error log of SDHI and MMCIF and boot_log file.
So, Please fix this bug when you have time.


Best regards,
Cao Minh Hiep


[-- Attachment #2: boot_log.txt --]
[-- Type: text/plain, Size: 11159 bytes --]

root@linaro-nano:~# dmesg
Booting Linux on physical CPU 0x0
Linux version 3.16.0-rc5 (jinso@jinso-OptiPlex-980) (gcc version 4.8.3 20140401 (prereleas4
CPU: ARMv7 Processor [413fc0f2] revision 2 (ARMv7), cr=10c5347d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Ignoring memory block 0x180000000 - 0x200000000
Machine model: Lager
debug: ignoring loglevel setting.
Memory policy: Data cache writealloc
On node 0 totalpages: 524288
free_area_init_node: node 0, pgdat c0603b00, node_mem_map ee7f9000
  Normal zone: 1520 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 194560 pages, LIFO batch:31
  HighMem zone: 2576 pages used for memmap
  HighMem zone: 329728 pages, LIFO batch:31
PERCPU: Embedded 5 pages/cpu @ee79e000 s6912 r0 d13568 u32768
pcpu-alloc: s6912 r0 d13568 u32768 alloc=8*4096
pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 522768
Kernel command line: console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 2073328K/2097152K available (4615K kernel code, 196K rwdata, 1068K rodata, 242K in)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
      .text : 0xc0008000 - 0xc0595f8c   (5688 kB)
      .init : 0xc0596000 - 0xc05d2b00   ( 243 kB)
      .data : 0xc05d4000 - 0xc0605280   ( 197 kB)
       .bss : 0xc0605288 - 0xc0636bf4   ( 199 kB)
Hierarchical RCU implementation.
NR_IRQS:16 nr_irqs:16 16
Architected cp15 timer(s) running at 10.00MHz (virt).
sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 3435973836800ns
Switching to timer-based delay loop
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS )
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: update cpu_capacity 1535
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x40489258 - 0x404892b0
CPU1: Booted secondary processor
CPU1: update cpu_capacity 1535
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU2: Booted secondary processor
CPU2: update cpu_capacity 1535
CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
CPU3: Booted secondary processor
CPU3: update cpu_capacity 1535
CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
CPU4: failed to boot: -22
CPU5: failed to boot: -22
CPU6: failed to boot: -22
CPU7: failed to boot: -22
Brought up 4 CPUs
SMP: Total of 4 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
pinctrl core: initialized pinctrl subsystem
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
renesas_irqc e61c0000.interrupt-controller: driving 4 irqs
sh-pfc e6060000.pfc: r8a77900_pfc support registered
No ATAGs?
hw-breakpoint: Failed to enable monitor mode on CPU 1.
fixed-3.3V: 3300 mV 
platform regulator@1: Driver reg-fixed-voltage requests probe deferral
platform regulator@3: Driver reg-fixed-voltage requests probe deferral
gpio-regulator regulator@2: Could not obtain regulator setting GPIOs: -517
platform regulator@2: Driver gpio-regulator requests probe deferral
gpio-regulator regulator@4: Could not obtain regulator setting GPIOs: -517
platform regulator@4: Driver gpio-regulator requests probe deferral
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
sh_cmt sh-cmt-48-gen2.0: ch0: used for clock events
sh_cmt sh-cmt-48-gen2.0: ch1: used as clock source
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
futex hash table entries: 2048 (order: 5, 131072 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
msgmni has been set to 1473
bounce: pool size: 64 pages
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
gpio_rcar e6050000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6050000.gpio: driving 32 GPIOs
gpio_rcar e6051000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6051000.gpio: driving 32 GPIOs
gpio_rcar e6052000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6052000.gpio: driving 32 GPIOs
gpio_rcar e6053000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6053000.gpio: driving 32 GPIOs
gpio_rcar e6054000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6054000.gpio: driving 32 GPIOs
gpio_rcar e6055000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6055000.gpio: driving 32 GPIOs
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
SuperH (H)SCI(F) driver initialized
sh-sci e6e60000.serial: Runtime PM disabled, clock forced on.
e6e60000.serial: ttySC6 at MMIO 0xe6e60000 (irq = 184, base_baud = 0) is a scif
console [ttySC6] enabled
sh-sci e6e68000.serial: Runtime PM disabled, clock forced on.
e6e68000.serial: ttySC7 at MMIO 0xe6e68000 (irq = 185, base_baud = 0) is a scif
[drm] Initialized drm 1.1.0 20060810
rcar-du rcar-du-r8a7790: fb0:  frame buffer device
rcar-du rcar-du-r8a7790: registered panic notifier
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
[drm] Initialized rcar-du 1.0.0 20130110 on minor 0
sata_rcar ee500000.sata: Runtime PM disabled, clock forced on.
scsi0 : sata_rcar
ata1: SATA max UDMA/133 irq 138
renesas_spi e6b10000.spi: Runtime PM disabled, clock forced on.
m25p80 spi0.0: s25fl512s (65536 Kbytes)
3 ofpart partitions found on MTD device spi0.0
Creating 3 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "loader"
0x000000040000-0x000000440000 : "user"
0x000000440000-0x000004000000 : "flash"
renesas_spi e6b10000.spi: probed
spi_sh_msiof e6e10000.spi: Runtime PM disabled, clock forced on.
sh-eth ee700000.ethernet: Runtime PM disabled, clock forced on.
libphy: sh_mii: probed
sh-eth ee700000.ethernet eth0: Base address at 0xee700000, 2e:09:0a:00:6e:bc, IRQ 194.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
mousedev: PS/2 mouse device common for all mice
rcar_thermal e61f0000.thermal: Runtime PM disabled, clock forced on.
rcar_thermal e61f0000.thermal: 1 sensor probed
sh_mobile_sdhi ee100000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee100000.sd: Got CD GPIO #902.
platform ee100000.sd: Driver sh_mobile_sdhi requests probe deferral
sh_mobile_sdhi ee140000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee140000.sd: Got CD GPIO #918.
platform ee140000.sd: Driver sh_mobile_sdhi requests probe deferral
sh_mmcif ee220000.mmc: Runtime PM disabled, clock forced on.
sh_mmcif ee220000.mmc: No vqmmc regulator found
of_dma_request_slave_channel: dma-names property of node '/mmc@ee220000' missing or empty
sh_mmcif ee220000.mmc: driver version 2010-04-28
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
SDHI0 Vcc: 3300 mV 
SDHI2 Vcc: 3300 mV 
SDHI0 VccQ: 1800 <--> 3300 mV at 3300 mV 
SDHI2 VccQ: 1800 <--> 3300 mV at 3300 mV 
sh_mobile_sdhi ee100000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee100000.sd: Got CD GPIO #902.
of_dma_request_slave_channel: dma-names property of node '/sd@ee100000' missing or empty
sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 clock rate 97 MHz
sh_mobile_sdhi ee140000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee140000.sd: Got CD GPIO #918.
ata1: link resume succeeded after 1 retries
of_dma_request_slave_channel: dma-names property of node '/sd@ee140000' missing or empty
ata1: SATA link down (SStatus 0 SControl 300)
sh_mobile_sdhi ee140000.sd: mmc2 base at 0xee140000 clock rate 48 MHz
input: gpio_keys as /devices/gpio_keys/input/input0
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
mmc0: BKOPS_EN bit is not set
mmc0: new high speed MMC card at address 0001
mmcblk0: mmc0:0001 MMC08G 7.32 GiB 
mmcblk0boot0: mmc0:0001 MMC08G partition 1 2.00 MiB
mmcblk0boot1: mmc0:0001 MMC08G partition 2 2.00 MiB
 mmcblk0: p1 p2
 mmcblk0boot1: unknown partition table
 mmcblk0boot0: unknown partition table
sh-eth ee700000.ethernet eth0: attached PHY 1 (IRQ 416) to driver Micrel KSZ8041RNLI
Sending DHCP requests ..
sh-eth ee700000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
., OK
IP-Config: Got DHCP answer from 172.16.1.27, my address is 172.16.1.35
IP-Config: Complete:
     device=eth0, hwaddr=2e:09:0a:00:6e:bc, ipaddr=172.16.1.35, mask=255.255.255.0, gw=1727
     host=172.16.1.35, domain=, nis-domain=(none)
     bootserver=172.16.1.27, rootserver=172.16.1.27, rootpath=
     nameserver0=172.16.1.27
SDHI2 VccQ: disabling
SDHI0 VccQ: disabling
SDHI2 Vcc: disabling
SDHI0 Vcc: disabling
ALSA device list:
  No soundcards found.
VFS: Mounted root (nfs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 240K (c0596000 - c05d2000)
random: init urandom read with 65 bits of entropy available
random: nonblocking pool is initialized
systemd-udevd[657]: starting version 204
CPU4: failed to boot: -22
CPU5: failed to boot: -22
CPU6: failed to boot: -22
CPU7: failed to boot: -22
init: plymouth main process (571) killed by ABRT signal
init: plymouth-splash main process (962) terminated with status 2
init: failsafe main process (1014) killed by TERM signal
init: plymouth-stop pre-start process (1129) terminated with status 1
init: tty1 main process (1131) killed by TERM signal


[-- Attachment #3: mmc_test-error-log_20140718.txt --]
[-- Type: text/plain, Size: 8040 bytes --]

root@linaro-nano:~# mount /dev/mmcblk0p1 /mnt/eMMC/
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p1): using internal journal
EXT3-fs (mmcblk0p1): recovery complete
EXT3-fs (mmcblk0p1): mounted filesystem with ordered data mode
root@linaro-nano:~# mount -t tmpfs -o size=400m tmpfs /tmp/
root@linaro-nano:~# dd if=/dev/urandom of=/tmp/file-100mb bs=1M count=10

10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 3.29865 s, 3.2 MB/s
root@linaro-nano:~# 
root@linaro-nano:~# cp /tmp/file-100mb /mnt/eMMC/
root@linaro-nano:~# cUnable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 17 [#1] SMP ARM
CPU: 1 PID: 494 Comm: irq/202-ee22000 Not tainted 3.16.0-rc5 #1
task: ed972040 ti: ee3b8000 task.ti: ee3b8000
PC is at sh_mmcif_irqt+0x944/0xc18
LR is at sh_mmcif_irqt+0x30/0xc18
pc : [<c0355638>]    lr : [<c0354d24>]    psr: 80070013
sp : ee3b9ea8  ip : ee3b9ea8  fp : ee3b9efc
r10: 00000001  r9 : c005f688  r8 : ee3b8000
r7 : ee2eade0  r6 : ed8610f8  r5 : ed861034  r4 : edb76680
r3 : 00000000  r2 : 00000200  r1 : 00000000  r0 : edb766f8
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5347d  Table: 6d16806a  DAC: 00000015
Process irq/202-ee22000 (pid: 494, stack limit = 0xee3b8240)
Stack: (0xee3b9ea8 to 0xee3ba000)
9ea0:                   00000000 c005f688 00000000 ee010a74 60070013 00000001
9ec0: 00000003 edb766b4 c005f688 edb766f8 ee3b9f0c ee2eadc0 ee2eadc0 ee010a00
9ee0: ee2eade0 ee3b8000 c005f688 00000001 ee3b9f1c ee3b9f00 c005f6ac c0354d00
9f00: 00000004 ee010a00 ee2eadc0 ee3b8020 ee3b9f5c ee3b9f20 c005f990 c005f694
9f20: c0055b6c 00000000 00000000 c005f7e4 c005f898 ee2ead80 00000000 ee2eadc0
9f40: c005f898 00000000 00000000 00000000 ee3b9fac ee3b9f60 c003f5a0 c005f8a4
9f60: ee3b9f60 00000000 00000000 ee2eadc0 00000000 00000000 ee3b9f78 ee3b9f78
9f80: 00000000 00000000 ee3b9f88 ee3b9f88 ee2ead80 c003f4b0 00000000 00000000
9fa0: 00000000 ee3b9fb0 c000e958 c003f4bc 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
Backtrace: 
[<c0354cf4>] (sh_mmcif_irqt) from [<c005f6ac>] (irq_thread_fn+0x24/0x3c)
 r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee2eade0 r6:ee010a00 r5:ee2eadc0
 r4:ee2eadc0
[<c005f688>] (irq_thread_fn) from [<c005f990>] (irq_thread+0xf8/0x174)
 r6:ee3b8020 r5:ee2eadc0 r4:ee010a00 r3:00000004
[<c005f898>] (irq_thread) from [<c003f5a0>] (kthread+0xf0/0x104)
 r10:00000000 r9:00000000 r8:00000000 r7:c005f898 r6:ee2eadc0 r5:00000000
 r4:ee2ead80
[<c003f4b0>] (kthread) from [<c000e958>] (ret_from_fork+0x14/0x3c)
 r7:00000000 r6:00000000 r5:c003f4b0 r4:ee2ead80
Code: e7f001f2 e5942068 e1530122 2a000004 (e4910004) 
---[ end trace 00854a296d6158ad ]---
Unable to handle kernel paging request at virtual address ffffffec
pgd = c0004000
[ffffffec] *pgd=6f7fd821, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2] SMP ARM
CPU: 1 PID: 494 Comm: irq/202-ee22000 Tainted: G      D       3.16.0-rc5 #1
task: ed972040 ti: ee3b8000 task.ti: ee3b8000
PC is at kthread_data+0x10/0x18
LR is at irq_thread_dtor+0x58/0xb4
pc : [<c003f748>]    lr : [<c005f83c>]    psr: 20070113
sp : ee3b9c00  ip : ee3b9c10  fp : ee3b9c0c
r10: c0355638  r9 : 00000001  r8 : ee3b9c60
r7 : ee3b8008  r6 : c0600a68  r5 : ed972040  r4 : ed972040
r3 : 00000000  r2 : ee3b9c10  r1 : ee3b9f28  r0 : ed972040
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5347d  Table: 6d16806a  DAC: 00000015
Process irq/202-ee22000 (pid: 494, stack limit = 0xee3b8240)
Stack: (0xee3b9c00 to 0xee3ba000)
9c00: ee3b9c24 ee3b9c10 c005f83c c003f744 ed972040 00000000 ee3b9c44 ee3b9c28
9c20: c003d014 c005f7f0 00000000 ed972040 00000000 c035563a ee3b9c7c ee3b9c48
9c40: c0026cc4 c003cf68 c0024bc4 c05de72c ee3b9e60 0000000b c035563a ee3b8000
9c60: ee3b9c7c ee3b9c70 c0024c88 ee3b8000 ee3b9cfc ee3b9c80 c00120bc c0026934
9c80: ee3b8240 0000000b 00000000 60070113 00000008 00000000 65000000 30306637
9ca0: 20326631 34393565 38363032 35316520 32313033 61322032 30303030 28203430
9cc0: 31393465 34303030 c0002029 c047faa0 c054045e 00000000 00000017 00000000
9ce0: ee3b9e60 ed972040 00000000 00000017 ee3b9d14 ee3b9d00 c047f3e4 c0011e08
9d00: ee3b9e60 ee3b9e60 ee3b9db4 ee3b9d18 c001a358 c047f394 00000000 00000001
9d20: c006eb28 00000001 ed411c38 ee7a7440 c05cd440 00000001 c05d6714 c05d009c
9d40: 00000100 c05cd440 ee3b9d8c ee3b9d58 c0050f58 c0050cb0 c002ede8 c048564c
9d60: ee3b9d60 00000020 ee3b8010 ee3b8000 c05d0088 c05d009c 00000000 ee3b8010
9d80: ee3b9ddc ee3b9d90 c002893c 00000017 c05db210 00000000 ee3b9e60 ee3b8000
9da0: c005f688 00000001 ee3b9e5c ee3b9db8 c00091d8 c001a054 ee7a7440 ee3b8000
9dc0: c05ccaf4 00000000 ee3b9e6c 00000064 ee7a7440 ed9720f0 ee7a74f0 c05d6714
9de0: 00000000 ee7a7440 ee3b9e24 ee3b9df8 c0052fac c0051f94 c05cd440 ed972040
9e00: ee3b9e2c ee3b9e10 c002e8dc c04855f4 edb766c4 ee2eadc0 ee3b9e6c ee3b9e28
9e20: c003a36c c0037894 c002f58c c0485700 c0042dcc a0070093 edb766b4 ee2eadc0
9e40: c0355638 80070013 ffffffff ee3b9e94 ee3b9efc ee3b9e60 c0012958 c00091a8
9e60: edb766f8 00000000 00000200 00000000 edb76680 ed861034 ed8610f8 ee2eade0
9e80: ee3b8000 c005f688 00000001 ee3b9efc ee3b9ea8 ee3b9ea8 c0354d24 c0355638
9ea0: 80070013 ffffffff 00000000 c005f688 00000000 ee010a74 60070013 00000001
9ec0: 00000003 edb766b4 c005f688 edb766f8 ee3b9f0c ee2eadc0 ee2eadc0 ee010a00
9ee0: ee2eade0 ee3b8000 c005f688 00000001 ee3b9f1c ee3b9f00 c005f6ac c0354d00
9f00: 00000004 ee010a00 ee2eadc0 ee3b8020 ee3b9f5c ee3b9f20 c005f990 c005f694
9f20: c0055b6c 00000000 00000000 c005f7e4 c005f898 ee2ead80 00000000 ee2eadc0
9f40: c005f898 00000000 00000000 00000000 ee3b9fac ee3b9f60 c003f5a0 c005f8a4
9f60: ee3b9f60 00000000 00000000 ee2eadc0 00000000 00000000 ee3b9f78 ee3b9f78
9f80: 00000001 00010001 ee3b9f88 ee3b9f88 ee2ead80 c003f4b0 00000000 00000000
9fa0: 00000000 ee3b9fb0 c000e958 c003f4bc 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
Backtrace: 
[<c003f738>] (kthread_data) from [<c005f83c>] (irq_thread_dtor+0x58/0xb4)
[<c005f7e4>] (irq_thread_dtor) from [<c003d014>] (task_work_run+0xb8/0xd0)
 r5:00000000 r4:ed972040
[<c003cf5c>] (task_work_run) from [<c0026cc4>] (do_exit+0x39c/0x884)
 r6:c035563a r5:00000000 r4:ed972040 r3:00000000
[<c0026928>] (do_exit) from [<c00120bc>] (die+0x2c0/0x3c4)
 r7:ee3b8000
[<c0011dfc>] (die) from [<c047f3e4>] (__do_kernel_fault.part.11+0x5c/0x7c)
 r10:00000017 r9:00000000 r8:ed972040 r7:ee3b9e60 r6:00000000 r5:00000017
 r4:00000000
[<c047f388>] (__do_kernel_fault.part.11) from [<c001a358>] (do_page_fault+0x310/0x370)
 r7:ee3b9e60 r3:ee3b9e60
[<c001a048>] (do_page_fault) from [<c00091d8>] (do_DataAbort+0x3c/0xa0)
 r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee3b9e60 r6:00000000 r5:c05db210
 r4:00000017
[<c000919c>] (do_DataAbort) from [<c0012958>] (__dabt_svc+0x38/0x60)
Exception stack(0xee3b9e60 to 0xee3b9ea8)
9e60: edb766f8 00000000 00000200 00000000 edb76680 ed861034 ed8610f8 ee2eade0
9e80: ee3b8000 c005f688 00000001 ee3b9efc ee3b9ea8 ee3b9ea8 c0354d24 c0355638
9ea0: 80070013 ffffffff
 r7:ee3b9e94 r6:ffffffff r5:80070013 r4:c0355638
[<c0354cf4>] (sh_mmcif_irqt) from [<c005f6ac>] (irq_thread_fn+0x24/0x3c)
 r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee2eade0 r6:ee010a00 r5:ee2eadc0
 r4:ee2eadc0
[<c005f688>] (irq_thread_fn) from [<c005f990>] (irq_thread+0xf8/0x174)
 r6:ee3b8020 r5:ee2eadc0 r4:ee010a00 r3:00000004
[<c005f898>] (irq_thread) from [<c003f5a0>] (kthread+0xf0/0x104)
 r10:00000000 r9:00000000 r8:00000000 r7:c005f898 r6:ee2eadc0 r5:00000000
 r4:ee2ead80
[<c003f4b0>] (kthread) from [<c000e958>] (ret_from_fork+0x14/0x3c)
 r7:00000000 r6:00000000 r5:c003f4b0 r4:ee2ead80
Code: e1a0c00d e92dd800 e24cb004 e5903238 (e5130014) 
---[ end trace 00854a296d6158ae ]---
Fixing recursive fault but reboot is needed!

[-- Attachment #4: sdhi_test_error_log_20140718.txt --]
[-- Type: text/plain, Size: 7784 bytes --]

root@linaro-nano:~# mount -t tmpfs -o size=400m tmpfs /tmp/
root@linaro-nano:~# dd if=/dev/urandom of=/tmp/file-100mb bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 32.9928 s, 3.2 MB/s
root@linaro-nano:~# mount /dev/mmcblk1p1 /mnt/sd1/
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk1p1): using internal journal
EXT3-fs (mmcblk1p1): mounted filesystem with ordered data mode
root@linaro-nano:~# sync; echo 3 > /proc/sys/vm/drop_caches
bash (1177): drop_caches: 3
root@linaro-nano:~# cp /tmp/file-100mb /mnt/sd1/
Unable to handle kernel paging request at virtual address ffc03000
pgd = c0004000
[ffc03000] *pgd=6f7fa811, *pte=00000000, *ppte=00000000
Internal error: Oops: 7 [#1] SMP ARM
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.0-rc5 #2
task: c05df418 ti: c05d4000 task.ti: c05d4000
PC is at __raw_writesw+0x1c/0xe4
LR is at __tmio_mmc_sdcard_irq+0x270/0x42c
pc : [<c047d5bc>]    lr : [<c0355de8>]    psr: 200f0193
sp : c05d5e2c  ip : 00000000  fp : c05d5e5c
r10: c06050f3  r9 : ee0107c0  r8 : 00000200
r7 : ffc00000  r6 : ed01a610  r5 : a00f0193  r4 : ed9e5a80
r3 : 00000000  r2 : 000000f8  r1 : ffc03000  r0 : f00bc030
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5347d  Table: 69a7c06a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0xc05d4240)
Stack: (0xc05d5e2c to 0xc05d6000)
5e20:                            ed9e5a80 a00f0193 c0355de8 02000000 ed9e5a80
5e40: 000000c7 00000000 00000000 ef7fcc40 c05d5e7c c05d5e60 c035615c c0355b84
5e60: 02000000 42800700 ed9e6d00 000000c7 c05d5eb4 c05d5e80 c005f174 c035611c
5e80: c0070fac c0047f94 ee7a01c0 ee0107c0 c05ebf04 00000000 c05d5f74 ef7fcc40
5ea0: 413fc0f2 00000000 c05d5ecc c05d5eb8 c005f2b4 c005f148 ee0107c0 c05ebf04
5ec0: c05d5ee4 c05d5ed0 c0062058 c005f278 000000c7 c05d1af4 c05d5efc c05d5ee8
5ee0: c005eb9c c0061fa8 000001a7 000000c7 c05d5f1c c05d5f00 c000f184 c005eb80
5f00: 000001a0 f0002000 c05d5f40 c05dc88c c05d5f3c c05d5f20 c0009320 c000f120
5f20: c000f484 c000f488 600f0013 ffffffff c05d5f94 c05d5f40 c00129c0 c00092e8
5f40: ee79e420 00000000 0011f146 00000000 c05d4018 c05d4000 c05d4000 c05c7dc0
5f60: ef7fcc40 413fc0f2 00000000 c05d5f94 c05d5f98 c05d5f88 c000f484 c000f488
5f80: 600f0013 ffffffff c05d5fa4 c05d5f98 c00562c0 c000f468 c05d5fb4 c05d5fa8
5fa0: c0480d0c c00561d8 c05d5ff4 c05d5fb8 c0596b74 c0480cb0 ffffffff ffffffff
5fc0: c0596644 00000000 00000000 c05c7dc0 00000000 c0605654 c05dc40c c05c7dbc
5fe0: c05e0498 4000406a 00000000 c05d5ff8 40008074 c05968b4 00000000 00000000
Backtrace: 
[<c0355b78>] (__tmio_mmc_sdcard_irq) from [<c035615c>] (tmio_mmc_irq+0x4c/0x6c)
 r8:ef7fcc40 r7:00000000 r6:00000000 r5:000000c7 r4:ed9e5a80 r3:02000000
[<c0356110>] (tmio_mmc_irq) from [<c005f174>] (handle_irq_event_percpu+0x38/0x130)
 r5:000000c7 r4:ed9e6d00
[<c005f13c>] (handle_irq_event_percpu) from [<c005f2b4>] (handle_irq_event+0x48/0x68)
 r10:00000000 r9:413fc0f2 r8:ef7fcc40 r7:c05d5f74 r6:00000000 r5:c05ebf04
 r4:ee0107c0
[<c005f26c>] (handle_irq_event) from [<c0062058>] (handle_fasteoi_irq+0xbc/0x144)
 r5:c05ebf04 r4:ee0107c0
[<c0061f9c>] (handle_fasteoi_irq) from [<c005eb9c>] (generic_handle_irq+0x28/0x38)
 r5:c05d1af4 r4:000000c7
[<c005eb74>] (generic_handle_irq) from [<c000f184>] (handle_IRQ+0x70/0x98)
 r4:000000c7 r3:000001a7
[<c000f114>] (handle_IRQ) from [<c0009320>] (gic_handle_irq+0x44/0x68)
 r6:c05dc88c r5:c05d5f40 r4:f0002000 r3:000001a0
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xc05d5f40 to 0xc05d5f88)
5f40: ee79e420 00000000 0011f146 00000000 c05d4018 c05d4000 c05d4000 c05c7dc0
5f60: ef7fcc40 413fc0f2 00000000 c05d5f94 c05d5f98 c05d5f88 c000f484 c000f488
5f80: 600f0013 ffffffff
 r6:ffffffff r5:600f0013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c0480d0c>] (rest_init+0x68/0x80)
[<c0480ca4>] (rest_init) from [<c0596b74>] (start_kernel+0x2cc/0x31c)
[<c05968a8>] (start_kernel) from [<40008074>] (0x40008074)
Code: 1afffff6 e92d4030 e2522008 4a00000e (e8b11038) 
---[ end trace b95a7313963532bd ]---
Kernel panic - not syncing: Fatal exception in interrupt
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D       3.16.0-rc5 #2
Backtrace: 
[<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c)
 r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040
[<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98)
[<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c)
 r4:00000001 r3:600f0193
[<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68)
 r6:c05dc88c r5:ee09bf78 r4:f0002000 r3:00000005
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xee09bf78 to 0xee09bfc0)
bf60:                                                       ee7a6420 00000000
bf80: 0000542e 00000000 ee09a010 ee09a000 ee09a000 c06056cc 4000406a 413fc0f2
bfa0: 00000000 ee09bfcc ee09bfd0 ee09bfc0 c000f484 c000f488 600f0013 ffffffff
 r6:ffffffff r5:600f0013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140)
[<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4)
 r4:6e06406a r3:c00093cc
CPU3: stopping
CPU: 3 PID: 0 Comm: swapper/3 Tainted: G      D       3.16.0-rc5 #2
Backtrace: 
[<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c)
 r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040
[<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98)
[<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c)
 r4:00000003 r3:60070193
[<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68)
 r6:c05dc88c r5:ee09ff78 r4:f0002000 r3:00000005
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xee09ff78 to 0xee09ffc0)
ff60:                                                       ee7b6420 00000000
ff80: 000037ec 00000000 ee09e010 ee09e000 ee09e000 c06056cc 4000406a 413fc0f2
ffa0: 00000000 ee09ffcc ee09ffd0 ee09ffc0 c000f484 c000f488 60070013 ffffffff
 r6:ffffffff r5:60070013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140)
[<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4)
 r4:6e06406a r3:c00093cc
CPU2: stopping
CPU: 2 PID: 0 Comm: swapper/2 Tainted: G      D       3.16.0-rc5 #2
Backtrace: 
[<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c)
 r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040
[<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98)
[<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c)
 r4:00000002 r3:60070193
[<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68)
 r6:c05dc88c r5:ee09df78 r4:f0002000 r3:00000005
[<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50)
Exception stack(0xee09df78 to 0xee09dfc0)
df60:                                                       ee7ae420 00000000
df80: 00003e08 00000000 ee09c010 ee09c000 ee09c000 c06056cc 4000406a 413fc0f2
dfa0: 00000000 ee09dfcc ee09dfd0 ee09dfc0 c000f484 c000f488 60070013 ffffffff
 r6:ffffffff r5:60070013 r4:c000f488 r3:c000f484
[<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154)
[<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140)
[<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4)
 r4:6e06406a r3:c00093cc
drm_kms_helper: panic occurred, switching back to text console
---[ end Kernel panic - not syncing: Fatal exception in interrupt

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

* [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-08-05  3:16               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:16 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
Current driver has SoC level .compatible
(r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..cb3bb39 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
 	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+	{ .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+	{ .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
 	{},
-- 
1.7.9.5


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

* [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
@ 2014-08-05  3:16               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:16 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
Current driver has SoC level .compatible
(r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..cb3bb39 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
 	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+	{ .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+	{ .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
 	{},
-- 
1.7.9.5


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

* [PATCH 2/5] ARM: shmobile: r8a7778: add generation level compatible for SDHI
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-08-05  3:17               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7778.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
index ecfdf4b..7986cf27 100644
--- a/arch/arm/boot/dts/r8a7778.dtsi
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -206,7 +206,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -215,7 +215,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -224,7 +224,7 @@
 	};
 
 	sdhi2: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
-- 
1.7.9.5


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

* [PATCH 2/5] ARM: shmobile: r8a7778: add generation level compatible for SDHI
@ 2014-08-05  3:17               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7778.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
index ecfdf4b..7986cf27 100644
--- a/arch/arm/boot/dts/r8a7778.dtsi
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -206,7 +206,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -215,7 +215,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -224,7 +224,7 @@
 	};
 
 	sdhi2: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
-- 
1.7.9.5


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

* [PATCH 3/5] ARM: shmobile: r8a7779: add generation level compatible for SDHI
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-08-05  3:17               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7779.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index 463e3fd..e56e174 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -316,7 +316,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
@@ -326,7 +326,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
@@ -336,7 +336,7 @@
 	};
 
 	sdhi2: sd@ffe4e000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4e000 0x100>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
@@ -346,7 +346,7 @@
 	};
 
 	sdhi3: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 3/5] ARM: shmobile: r8a7779: add generation level compatible for SDHI
@ 2014-08-05  3:17               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7779.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index 463e3fd..e56e174 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -316,7 +316,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
@@ -326,7 +326,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
@@ -336,7 +336,7 @@
 	};
 
 	sdhi2: sd@ffe4e000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4e000 0x100>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
@@ -346,7 +346,7 @@
 	};
 
 	sdhi3: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 4/5] ARM: shmobile: r8a7790: add generation level compatible for SDHI
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-08-05  3:17               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7790.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 7218bff..570e433 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -353,7 +353,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -362,7 +362,7 @@
 	};
 
 	sdhi1: sd@ee120000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee120000 0 0x200>;
 		interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -371,7 +371,7 @@
 	};
 
 	sdhi2: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -380,7 +380,7 @@
 	};
 
 	sdhi3: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 4/5] ARM: shmobile: r8a7790: add generation level compatible for SDHI
@ 2014-08-05  3:17               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7790.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 7218bff..570e433 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -353,7 +353,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -362,7 +362,7 @@
 	};
 
 	sdhi1: sd@ee120000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee120000 0 0x200>;
 		interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -371,7 +371,7 @@
 	};
 
 	sdhi2: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -380,7 +380,7 @@
 	};
 
 	sdhi3: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 5/5] ARM: shmobile: r8a7791: add generation level compatible for SDHI
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-08-05  3:17               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7791.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1e97113..82be0af 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -341,7 +341,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
@@ -349,7 +349,7 @@
 	};
 
 	sdhi1: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
@@ -357,7 +357,7 @@
 	};
 
 	sdhi2: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
-- 
1.7.9.5


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

* [PATCH 5/5] ARM: shmobile: r8a7791: add generation level compatible for SDHI
@ 2014-08-05  3:17               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05  3:17 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas), linux-mmc

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/boot/dts/r8a7791.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1e97113..82be0af 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -341,7 +341,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
@@ -349,7 +349,7 @@
 	};
 
 	sdhi1: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
@@ -357,7 +357,7 @@
 	};
 
 	sdhi2: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
-- 
1.7.9.5


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

* Re: [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
  2014-08-05  3:16               ` Kuninori Morimoto
@ 2014-08-05  6:59                 ` Geert Uytterhoeven
  -1 siblings, 0 replies; 152+ messages in thread
From: Geert Uytterhoeven @ 2014-08-05  6:59 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Magnus, Linux-SH, goda, Linux MMC List

On Tue, Aug 5, 2014 at 5:16 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> Current driver has SoC level .compatible
> (r8a7778/r8a7779/r8a7790/r8a7791),
> but these can be match as generation level.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/mmc/host/sh_mobile_sdhi.c |    2 ++
>  1 file changed, 2 insertions(+)

I think you should also update
Documentation/devicetree/bindings/mmc/tmio_mmc.txt

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
@ 2014-08-05  6:59                 ` Geert Uytterhoeven
  0 siblings, 0 replies; 152+ messages in thread
From: Geert Uytterhoeven @ 2014-08-05  6:59 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Magnus, Linux-SH, goda, Linux MMC List

On Tue, Aug 5, 2014 at 5:16 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> Current driver has SoC level .compatible
> (r8a7778/r8a7779/r8a7790/r8a7791),
> but these can be match as generation level.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/mmc/host/sh_mobile_sdhi.c |    2 ++
>  1 file changed, 2 insertions(+)

I think you should also update
Documentation/devicetree/bindings/mmc/tmio_mmc.txt

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
  2014-08-05  6:59                 ` Geert Uytterhoeven
@ 2014-08-05 23:45                   ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05 23:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon, Chris Ball, Magnus, Linux-SH, goda, Linux MMC List


Hi Geert

> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> > Current driver has SoC level .compatible
> > (r8a7778/r8a7779/r8a7790/r8a7791),
> > but these can be match as generation level.
> >
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  drivers/mmc/host/sh_mobile_sdhi.c |    2 ++
> >  1 file changed, 2 insertions(+)
> 
> I think you should also update
> Documentation/devicetree/bindings/mmc/tmio_mmc.txt

Indeed, thanks
Will do in v2

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
@ 2014-08-05 23:45                   ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-05 23:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Simon, Chris Ball, Magnus, Linux-SH, goda, Linux MMC List


Hi Geert

> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> > Current driver has SoC level .compatible
> > (r8a7778/r8a7779/r8a7790/r8a7791),
> > but these can be match as generation level.
> >
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  drivers/mmc/host/sh_mobile_sdhi.c |    2 ++
> >  1 file changed, 2 insertions(+)
> 
> I think you should also update
> Documentation/devicetree/bindings/mmc/tmio_mmc.txt

Indeed, thanks
Will do in v2

Best regards
---
Kuninori Morimoto

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

* [PATCH 0/5 v2] mmc: shmobile: adds generatoin level DT compatible
  2014-07-29  8:42             ` Kuninori Morimoto
@ 2014-08-06  1:47               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto


Hi Chris, Simon

These are v2 patches of Renesas SDHI driver.
These patches add R-Car generatoin level
DT compatible on driver/platform.

Kuninori Morimoto (5):
      mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
      ARM: shmobile: r8a7778: add generation level compatible for SDHI
      ARM: shmobile: r8a7779: add generation level compatible for SDHI
      ARM: shmobile: r8a7790: add generation level compatible for SDHI
      ARM: shmobile: r8a7791: add generation level compatible for SDHI

 Documentation/devicetree/bindings/mmc/tmio_mmc.txt |    2 ++
 arch/arm/boot/dts/r8a7778.dtsi                     |    6 +++---
 arch/arm/boot/dts/r8a7779.dtsi                     |    8 ++++----
 arch/arm/boot/dts/r8a7790.dtsi                     |    8 ++++----
 arch/arm/boot/dts/r8a7791.dtsi                     |    6 +++---
 drivers/mmc/host/sh_mobile_sdhi.c                  |    2 ++
 6 files changed, 18 insertions(+), 14 deletions(-)


Best regards
---
Kuninori Morimoto

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

* [PATCH 0/5 v2] mmc: shmobile: adds generatoin level DT compatible
@ 2014-08-06  1:47               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:47 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto


Hi Chris, Simon

These are v2 patches of Renesas SDHI driver.
These patches add R-Car generatoin level
DT compatible on driver/platform.

Kuninori Morimoto (5):
      mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
      ARM: shmobile: r8a7778: add generation level compatible for SDHI
      ARM: shmobile: r8a7779: add generation level compatible for SDHI
      ARM: shmobile: r8a7790: add generation level compatible for SDHI
      ARM: shmobile: r8a7791: add generation level compatible for SDHI

 Documentation/devicetree/bindings/mmc/tmio_mmc.txt |    2 ++
 arch/arm/boot/dts/r8a7778.dtsi                     |    6 +++---
 arch/arm/boot/dts/r8a7779.dtsi                     |    8 ++++----
 arch/arm/boot/dts/r8a7790.dtsi                     |    8 ++++----
 arch/arm/boot/dts/r8a7791.dtsi                     |    6 +++---
 drivers/mmc/host/sh_mobile_sdhi.c                  |    2 ++
 6 files changed, 18 insertions(+), 14 deletions(-)


Best regards
---
Kuninori Morimoto

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

* [PATCH 1/5 v2] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
  2014-08-06  1:47               ` Kuninori Morimoto
@ 2014-08-06  1:48                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:48 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
Current driver has SoC level .compatible
(r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.

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

 - update tmio_mmc.txt

 Documentation/devicetree/bindings/mmc/tmio_mmc.txt |    2 ++
 drivers/mmc/host/sh_mobile_sdhi.c                  |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index 6a2a116..51c05cf 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -11,6 +11,8 @@ optional bindings can be used.
 
 Required properties:
 - compatible:	"renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
+		"renesas,sdhi-rcar-gen1" - a generic R-Car Gen1 SDHI unit
+		"renesas,sdhi-rcar-gen2" - a generic R-Car Gen2 SDHI unit
 		"renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
 		"renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
 		"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..cb3bb39 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
 	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+	{ .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+	{ .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
 	{},
-- 
1.7.9.5


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

* [PATCH 1/5 v2] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
@ 2014-08-06  1:48                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:48 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
Current driver has SoC level .compatible
(r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.

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

 - update tmio_mmc.txt

 Documentation/devicetree/bindings/mmc/tmio_mmc.txt |    2 ++
 drivers/mmc/host/sh_mobile_sdhi.c                  |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index 6a2a116..51c05cf 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -11,6 +11,8 @@ optional bindings can be used.
 
 Required properties:
 - compatible:	"renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
+		"renesas,sdhi-rcar-gen1" - a generic R-Car Gen1 SDHI unit
+		"renesas,sdhi-rcar-gen2" - a generic R-Car Gen2 SDHI unit
 		"renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
 		"renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
 		"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..cb3bb39 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
 	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
 	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+	{ .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+	{ .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
 	{},
-- 
1.7.9.5


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

* [PATCH 2/5 v2] ARM: shmobile: r8a7778: add generation level compatible for SDHI
  2014-08-06  1:47               ` Kuninori Morimoto
@ 2014-08-06  1:49                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:49 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

 - no change

 arch/arm/boot/dts/r8a7778.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
index ecfdf4b..7986cf27 100644
--- a/arch/arm/boot/dts/r8a7778.dtsi
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -206,7 +206,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -215,7 +215,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -224,7 +224,7 @@
 	};
 
 	sdhi2: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
-- 
1.7.9.5


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

* [PATCH 2/5 v2] ARM: shmobile: r8a7778: add generation level compatible for SDHI
@ 2014-08-06  1:49                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:49 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

 - no change

 arch/arm/boot/dts/r8a7778.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
index ecfdf4b..7986cf27 100644
--- a/arch/arm/boot/dts/r8a7778.dtsi
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -206,7 +206,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -215,7 +215,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
@@ -224,7 +224,7 @@
 	};
 
 	sdhi2: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7778";
+		compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
 		cap-sd-highspeed;
-- 
1.7.9.5


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

* [PATCH 3/5 v2] ARM: shmobile: r8a7779: add generation level compatible for SDHI
  2014-08-06  1:47               ` Kuninori Morimoto
@ 2014-08-06  1:49                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:49 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

- no change

 arch/arm/boot/dts/r8a7779.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index 463e3fd..e56e174 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -316,7 +316,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
@@ -326,7 +326,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
@@ -336,7 +336,7 @@
 	};
 
 	sdhi2: sd@ffe4e000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4e000 0x100>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
@@ -346,7 +346,7 @@
 	};
 
 	sdhi3: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 3/5 v2] ARM: shmobile: r8a7779: add generation level compatible for SDHI
@ 2014-08-06  1:49                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:49 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

- no change

 arch/arm/boot/dts/r8a7779.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index 463e3fd..e56e174 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -316,7 +316,7 @@
 	};
 
 	sdhi0: sd@ffe4c000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4c000 0x100>;
 		interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
@@ -326,7 +326,7 @@
 	};
 
 	sdhi1: sd@ffe4d000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4d000 0x100>;
 		interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
@@ -336,7 +336,7 @@
 	};
 
 	sdhi2: sd@ffe4e000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4e000 0x100>;
 		interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
@@ -346,7 +346,7 @@
 	};
 
 	sdhi3: sd@ffe4f000 {
-		compatible = "renesas,sdhi-r8a7779";
+		compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1";
 		reg = <0xffe4f000 0x100>;
 		interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 4/5 v2] ARM: shmobile: r8a7790: add generation level compatible for SDHI
  2014-08-06  1:47               ` Kuninori Morimoto
@ 2014-08-06  1:49                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:49 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

- no change

 arch/arm/boot/dts/r8a7790.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 7218bff..570e433 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -353,7 +353,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -362,7 +362,7 @@
 	};
 
 	sdhi1: sd@ee120000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee120000 0 0x200>;
 		interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -371,7 +371,7 @@
 	};
 
 	sdhi2: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -380,7 +380,7 @@
 	};
 
 	sdhi3: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 4/5 v2] ARM: shmobile: r8a7790: add generation level compatible for SDHI
@ 2014-08-06  1:49                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:49 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

- no change

 arch/arm/boot/dts/r8a7790.dtsi |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 7218bff..570e433 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -353,7 +353,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -362,7 +362,7 @@
 	};
 
 	sdhi1: sd@ee120000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee120000 0 0x200>;
 		interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -371,7 +371,7 @@
 	};
 
 	sdhi2: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -380,7 +380,7 @@
 	};
 
 	sdhi3: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7790";
+		compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
-- 
1.7.9.5


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

* [PATCH 5/5 v2] ARM: shmobile: r8a7791: add generation level compatible for SDHI
  2014-08-06  1:47               ` Kuninori Morimoto
@ 2014-08-06  1:50                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:50 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

- no change

 arch/arm/boot/dts/r8a7791.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1e97113..82be0af 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -341,7 +341,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
@@ -349,7 +349,7 @@
 	};
 
 	sdhi1: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
@@ -357,7 +357,7 @@
 	};
 
 	sdhi2: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
-- 
1.7.9.5


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

* [PATCH 5/5 v2] ARM: shmobile: r8a7791: add generation level compatible for SDHI
@ 2014-08-06  1:50                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-06  1:50 UTC (permalink / raw)
  To: Simon, Chris Ball
  Cc: Magnus, Linux-SH, Geert Uytterhoeven, goda (Renesas),
	linux-mmc, Kuninori Morimoto

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

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

- no change

 arch/arm/boot/dts/r8a7791.dtsi |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 1e97113..82be0af 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -341,7 +341,7 @@
 	};
 
 	sdhi0: sd@ee100000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee100000 0 0x200>;
 		interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
@@ -349,7 +349,7 @@
 	};
 
 	sdhi1: sd@ee140000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee140000 0 0x100>;
 		interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
@@ -357,7 +357,7 @@
 	};
 
 	sdhi2: sd@ee160000 {
-		compatible = "renesas,sdhi-r8a7791";
+		compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2";
 		reg = <0 0xee160000 0 0x100>;
 		interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
-- 
1.7.9.5


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

* Re: [PATCH 1/5 v2] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
  2014-08-06  1:48                 ` Kuninori Morimoto
@ 2014-08-07  0:43                   ` Simon Horman
  -1 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-08-07  0:43 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Magnus, Linux-SH, Geert Uytterhoeven, goda,
	linux-mmc, Kuninori Morimoto

On Tue, Aug 05, 2014 at 06:48:42PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> Current driver has SoC level .compatible
> (r8a7778/r8a7779/r8a7790/r8a7791),
> but these can be match as generation level.

Is this compatibility explicitly documented anywhere?

> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
> 
>  - update tmio_mmc.txt
> 
>  Documentation/devicetree/bindings/mmc/tmio_mmc.txt |    2 ++
>  drivers/mmc/host/sh_mobile_sdhi.c                  |    2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> index 6a2a116..51c05cf 100644
> --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> @@ -11,6 +11,8 @@ optional bindings can be used.
>  
>  Required properties:
>  - compatible:	"renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
> +		"renesas,sdhi-rcar-gen1" - a generic R-Car Gen1 SDHI unit
> +		"renesas,sdhi-rcar-gen2" - a generic R-Car Gen2 SDHI unit
>  		"renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
>  		"renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
>  		"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 91058da..cb3bb39 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
>  	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
>  	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
>  	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
> +	{ .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
> +	{ .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
>  	{},
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 1/5 v2] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
@ 2014-08-07  0:43                   ` Simon Horman
  0 siblings, 0 replies; 152+ messages in thread
From: Simon Horman @ 2014-08-07  0:43 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Chris Ball, Magnus, Linux-SH, Geert Uytterhoeven, goda,
	linux-mmc, Kuninori Morimoto

On Tue, Aug 05, 2014 at 06:48:42PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> This patch adds DT compatible for Renesas R-Car Gen1/Gen2.
> Current driver has SoC level .compatible
> (r8a7778/r8a7779/r8a7790/r8a7791),
> but these can be match as generation level.

Is this compatibility explicitly documented anywhere?

> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
> 
>  - update tmio_mmc.txt
> 
>  Documentation/devicetree/bindings/mmc/tmio_mmc.txt |    2 ++
>  drivers/mmc/host/sh_mobile_sdhi.c                  |    2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> index 6a2a116..51c05cf 100644
> --- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
> @@ -11,6 +11,8 @@ optional bindings can be used.
>  
>  Required properties:
>  - compatible:	"renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
> +		"renesas,sdhi-rcar-gen1" - a generic R-Car Gen1 SDHI unit
> +		"renesas,sdhi-rcar-gen2" - a generic R-Car Gen2 SDHI unit
>  		"renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
>  		"renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
>  		"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 91058da..cb3bb39 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
>  	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
>  	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
>  	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
> +	{ .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
> +	{ .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
>  	{ .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
>  	{},
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 0/10 v2 resend] mmc: tmio: fixup patches
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-08-22  8:35             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:35 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Chris, Simon

These are resend of v2 fixup patches for mmc tmio/shmobile.
I tesed these patches on my environment,
and Nguyen, Hiep had tested on their environment.

Kuninori Morimoto (4):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
      mmc: tmio: ensure that the clock has been stopped before set_clock

Shinobu Uehara (6):
      mmc: block: add block number limitation flag for multiple block read
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
 drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
 drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
 include/linux/mmc/host.h               |    3 +++
 8 files changed, 110 insertions(+), 18 deletions(-)

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/10 v2 resend] mmc: tmio: fixup patches
@ 2014-08-22  8:35             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:35 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Chris, Simon

These are resend of v2 fixup patches for mmc tmio/shmobile.
I tesed these patches on my environment,
and Nguyen, Hiep had tested on their environment.

Kuninori Morimoto (4):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
      mmc: tmio: ensure that the clock has been stopped before set_clock

Shinobu Uehara (6):
      mmc: block: add block number limitation flag for multiple block read
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 arch/arm/mach-shmobile/board-koelsch.c |    6 ++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |   26 ++++++++++++++++++---
 drivers/mmc/host/tmio_mmc_dma.c        |    8 +++----
 drivers/mmc/host/tmio_mmc_pio.c        |   40 +++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h               |   22 ++++++++++++++++++
 include/linux/mmc/host.h               |    3 +++
 8 files changed, 110 insertions(+), 18 deletions(-)

Best regards
---
Kuninori Morimoto

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

* [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:36               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:36 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

In some 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.
MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ

[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
 include/linux/mmc/host.h               |    3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..32a2b2a 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +344,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +357,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..953f9c9 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +644,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..98c7e8c 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 
 		/* 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;
+		    rq_data_dir(req) = READ) {
+
+			if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
+				/*
+				 * In some 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 (brq->data.blocks = 2)
+					brq->data.blocks = 1;
+			} else {
+				brq->data.blocks = 1;
+			}
+		}
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..b3baa83 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..3510fba 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -266,6 +266,9 @@ 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_2BLKS_LIMIT	(1 << 4)	/* 2 blocks limit for multi read */
+#define MMC_CAP2_NO_2BLKS_READ	(MMC_CAP2_NO_MULTI_READ | \
+				 MMC_CAP2_2BLKS_LIMIT)
 #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] 152+ messages in thread

* [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
@ 2014-08-22  8:36               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:36 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

In some 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.
MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ

[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
 arch/arm/mach-shmobile/board-lager.c   |    4 ++--
 drivers/mmc/card/block.c               |   19 +++++++++++++++++--
 drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
 include/linux/mmc/host.h               |    3 +++
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7..32a2b2a 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -331,7 +331,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -344,7 +344,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT,
 };
 
@@ -357,7 +357,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215..953f9c9 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -630,7 +630,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
@@ -644,7 +644,7 @@ 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_caps2	= MMC_CAP2_NO_2BLKS_READ,
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT |
 			  TMIO_MMC_WRPROTECT_DISABLE,
 };
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index ede41f0..98c7e8c 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 
 		/* 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;
+		    rq_data_dir(req) == READ) {
+
+			if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
+				/*
+				 * In some 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 (brq->data.blocks == 2)
+					brq->data.blocks = 1;
+			} else {
+				brq->data.blocks = 1;
+			}
+		}
 	}
 
 	if (brq->data.blocks > 1 || do_rel_wr) {
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..b3baa83 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
-	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..3510fba 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -266,6 +266,9 @@ 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_2BLKS_LIMIT	(1 << 4)	/* 2 blocks limit for multi read */
+#define MMC_CAP2_NO_2BLKS_READ	(MMC_CAP2_NO_MULTI_READ | \
+				 MMC_CAP2_2BLKS_LIMIT)
 #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] 152+ messages in thread

* [PATCH 02/10 v2 resend] mmc: tmio: care about DMA tx/rx addr offset
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:37               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:37 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b3baa83..91c6399 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index eb8f1d5..bd646b0 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -312,7 +312,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 02/10 v2 resend] mmc: tmio: care about DMA tx/rx addr offset
@ 2014-08-22  8:37               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:37 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index b3baa83..91c6399 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_2BLKS_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index eb8f1d5..bd646b0 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -312,7 +312,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 03/10 v2 resend] mmc: tmio: clear error IRQ status
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:38               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:38 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 03/10 v2 resend] mmc: tmio: clear error IRQ status
@ 2014-08-22  8:38               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:38 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 04/10 v2 resend] mmc: tmio: control multiple block transfer mode
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:39               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:39 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91c6399..1d54b78 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode = SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 04/10 v2 resend] mmc: tmio: control multiple block transfer mode
@ 2014-08-22  8:39               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:39 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91c6399..1d54b78 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode == SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 05/10 v2 resend] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:40               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 1d54b78..ad00fb8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 05/10 v2 resend] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
@ 2014-08-22  8:40               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 1d54b78..ad00fb8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 06/10 v2 resend] mmc: tmio: check ILL_FUNC instead of CBSY
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:40               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 06/10 v2 resend] mmc: tmio: check ILL_FUNC instead of CBSY
@ 2014-08-22  8:40               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 07/10 v2 resend] mmc: tmio: remove Renesas specific #ifdef
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:40               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index ad00fb8..b6f94c8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index bd646b0..7d07738 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 07/10 v2 resend] mmc: tmio: remove Renesas specific #ifdef
@ 2014-08-22  8:40               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index ad00fb8..b6f94c8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index bd646b0..7d07738 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 08/10 v2 resend] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:40               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 08/10 v2 resend] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
@ 2014-08-22  8:40               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:40 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 09/10 v2 resend] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-08-22  8:35             ` Kuninori Morimoto
@ 2014-08-22  8:41               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:41 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..1c5a631 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power = TMIO_MMC_OFF_STOP)
 			tmio_mmc_reset(host);
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		if (host->power = TMIO_MMC_OFF_STOP)
 			/* power up SD card and the bus */
-- 
1.7.9.5


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

* [PATCH 09/10 v2 resend] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-08-22  8:41               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-22  8:41 UTC (permalink / raw)
  To: Simon, Chris Ball; +Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..1c5a631 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power == TMIO_MMC_OFF_STOP)
 			tmio_mmc_reset(host);
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		if (host->power == TMIO_MMC_OFF_STOP)
 			/* power up SD card and the bus */
-- 
1.7.9.5


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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
  2014-08-22  8:36               ` Kuninori Morimoto
@ 2014-08-22 10:31                 ` Ulf Hansson
  -1 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-22 10:31 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 22 August 2014 10:36, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>
> In some 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.

Can't his be solved in software in the host driver? Or is it pure bug in the HW?

> MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
> but, it is over-kill for this issue.
> This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
> when it was two blocks.
> This is additional option of MMC_CAP2_NO_MULTI_READ
>
> [Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
>
> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
>  arch/arm/mach-shmobile/board-lager.c   |    4 ++--

I prefer to split up patches into ARM patches and MMC patches if it's possible.
That makes it easier to review and collect acks from SoC maintainers.

>  drivers/mmc/card/block.c               |   19 +++++++++++++++++--
>  drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
>  include/linux/mmc/host.h               |    3 +++
>  5 files changed, 26 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
> index b7d5bc7..32a2b2a 100644
> --- a/arch/arm/mach-shmobile/board-koelsch.c
> +++ b/arch/arm/mach-shmobile/board-koelsch.c
> @@ -331,7 +331,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,

Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from
platform data. If this is HW bug, aren't that related to the actual
mmc controller and version of it - not the board/platform?

This applies to more caps and boards further down below in this patch as well.

To me, it seems like these belongs into the host driver instead!?

>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
>  };
>
> @@ -344,7 +344,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
>  };
>
> @@ -357,7 +357,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
>                           TMIO_MMC_WRPROTECT_DISABLE,
>  };
> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> index e1d8215..953f9c9 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
> @@ -630,7 +630,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
>                           TMIO_MMC_WRPROTECT_DISABLE,
>  };
> @@ -644,7 +644,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
>                           TMIO_MMC_WRPROTECT_DISABLE,
>  };
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index ede41f0..98c7e8c 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>
>                 /* 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;
> +                   rq_data_dir(req) = READ) {
> +
> +                       if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {

This conforms to what the commit message states, that
MMC_CAP2_2BLKS_LIMIT needs to be used together with
MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have
them separate.

Anyway, according to your cap configuration changes, you are replacing
MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding
it...

> +                               /*
> +                                * In some 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 (brq->data.blocks = 2)
> +                                       brq->data.blocks = 1;
> +                       } else {
> +                               brq->data.blocks = 1;
> +                       }
> +               }
>         }
>
>         if (brq->data.blocks > 1 || do_rel_wr) {
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 91058da..b3baa83 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
>  static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
>         .capabilities   = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
> -       .capabilities2  = MMC_CAP2_NO_MULTI_READ,
> +       .capabilities2  = MMC_CAP2_NO_2BLKS_READ,
>  };
>
>  static const struct of_device_id sh_mobile_sdhi_of_match[] = {
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 7960424..3510fba 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -266,6 +266,9 @@ 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_2BLKS_LIMIT   (1 << 4)        /* 2 blocks limit for multi read */
> +#define MMC_CAP2_NO_2BLKS_READ (MMC_CAP2_NO_MULTI_READ | \
> +                                MMC_CAP2_2BLKS_LIMIT)
>  #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
>

Kind regards
Uffe

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
@ 2014-08-22 10:31                 ` Ulf Hansson
  0 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-22 10:31 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 22 August 2014 10:36, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>
> In some 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.

Can't his be solved in software in the host driver? Or is it pure bug in the HW?

> MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
> but, it is over-kill for this issue.
> This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
> when it was two blocks.
> This is additional option of MMC_CAP2_NO_MULTI_READ
>
> [Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
>
> Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
> Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
>  arch/arm/mach-shmobile/board-lager.c   |    4 ++--

I prefer to split up patches into ARM patches and MMC patches if it's possible.
That makes it easier to review and collect acks from SoC maintainers.

>  drivers/mmc/card/block.c               |   19 +++++++++++++++++--
>  drivers/mmc/host/sh_mobile_sdhi.c      |    2 +-
>  include/linux/mmc/host.h               |    3 +++
>  5 files changed, 26 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
> index b7d5bc7..32a2b2a 100644
> --- a/arch/arm/mach-shmobile/board-koelsch.c
> +++ b/arch/arm/mach-shmobile/board-koelsch.c
> @@ -331,7 +331,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,

Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from
platform data. If this is HW bug, aren't that related to the actual
mmc controller and version of it - not the board/platform?

This applies to more caps and boards further down below in this patch as well.

To me, it seems like these belongs into the host driver instead!?

>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
>  };
>
> @@ -344,7 +344,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
>  };
>
> @@ -357,7 +357,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
>                           TMIO_MMC_WRPROTECT_DISABLE,
>  };
> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> index e1d8215..953f9c9 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
> @@ -630,7 +630,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
>                           TMIO_MMC_WRPROTECT_DISABLE,
>  };
> @@ -644,7 +644,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT |
>                           TMIO_MMC_WRPROTECT_DISABLE,
>  };
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index ede41f0..98c7e8c 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>
>                 /* 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;
> +                   rq_data_dir(req) == READ) {
> +
> +                       if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {

This conforms to what the commit message states, that
MMC_CAP2_2BLKS_LIMIT needs to be used together with
MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have
them separate.

Anyway, according to your cap configuration changes, you are replacing
MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding
it...

> +                               /*
> +                                * In some 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 (brq->data.blocks == 2)
> +                                       brq->data.blocks = 1;
> +                       } else {
> +                               brq->data.blocks = 1;
> +                       }
> +               }
>         }
>
>         if (brq->data.blocks > 1 || do_rel_wr) {
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 91058da..b3baa83 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
>  static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
>         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
>         .capabilities   = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
> -       .capabilities2  = MMC_CAP2_NO_MULTI_READ,
> +       .capabilities2  = MMC_CAP2_NO_2BLKS_READ,
>  };
>
>  static const struct of_device_id sh_mobile_sdhi_of_match[] = {
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 7960424..3510fba 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -266,6 +266,9 @@ 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_2BLKS_LIMIT   (1 << 4)        /* 2 blocks limit for multi read */
> +#define MMC_CAP2_NO_2BLKS_READ (MMC_CAP2_NO_MULTI_READ | \
> +                                MMC_CAP2_2BLKS_LIMIT)
>  #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
>

Kind regards
Uffe

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
  2014-08-22 10:31                 ` Ulf Hansson
@ 2014-08-25  0:53                   ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  0:53 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Ulf

Thank you for your feedback

> > MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
> > but, it is over-kill for this issue.
> > This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
> > when it was two blocks.
> > This is additional option of MMC_CAP2_NO_MULTI_READ
> >
> > [Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
> >
> > Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> > Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
> > Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
> >  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
> 
> I prefer to split up patches into ARM patches and MMC patches if it's possible.
> That makes it easier to review and collect acks from SoC maintainers.

I see. will do

> > @@ -331,7 +331,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
> 
> Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from
> platform data. If this is HW bug, aren't that related to the actual
> mmc controller and version of it - not the board/platform?

In historical reason, your idea can be implemented on DT case.
But above style is very normal for non-DT case in this driver...

> This applies to more caps and boards further down below in this patch as well.
> 
> To me, it seems like these belongs into the host driver instead!?

This issue is similar to MMC_CAP2_NO_MULTI_READ,
and it is located in block.c.
So, we added it there too.

If you can't accept it, we will consider it again.
But is it possilbe to keep consistency if host side exchange block size
without using framework ??

> > @@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
> >
> >                 /* 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;
> > +                   rq_data_dir(req) = READ) {
> > +
> > +                       if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
> 
> This conforms to what the commit message states, that
> MMC_CAP2_2BLKS_LIMIT needs to be used together with
> MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have
> them separate.
> 
> Anyway, according to your cap configuration changes, you are replacing
> MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding
> it...

Because this method will check caps2 flag twice for
MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case.
But, these are similar flag, and is no effect for almost all drivers.
We avoided such checks.


Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
@ 2014-08-25  0:53                   ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  0:53 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Ulf

Thank you for your feedback

> > MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
> > but, it is over-kill for this issue.
> > This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
> > when it was two blocks.
> > This is additional option of MMC_CAP2_NO_MULTI_READ
> >
> > [Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
> >
> > Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
> > Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
> > Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
> >  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
> 
> I prefer to split up patches into ARM patches and MMC patches if it's possible.
> That makes it easier to review and collect acks from SoC maintainers.

I see. will do

> > @@ -331,7 +331,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
> 
> Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from
> platform data. If this is HW bug, aren't that related to the actual
> mmc controller and version of it - not the board/platform?

In historical reason, your idea can be implemented on DT case.
But above style is very normal for non-DT case in this driver...

> This applies to more caps and boards further down below in this patch as well.
> 
> To me, it seems like these belongs into the host driver instead!?

This issue is similar to MMC_CAP2_NO_MULTI_READ,
and it is located in block.c.
So, we added it there too.

If you can't accept it, we will consider it again.
But is it possilbe to keep consistency if host side exchange block size
without using framework ??

> > @@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
> >
> >                 /* 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;
> > +                   rq_data_dir(req) == READ) {
> > +
> > +                       if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
> 
> This conforms to what the commit message states, that
> MMC_CAP2_2BLKS_LIMIT needs to be used together with
> MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have
> them separate.
> 
> Anyway, according to your cap configuration changes, you are replacing
> MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding
> it...

Because this method will check caps2 flag twice for
MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case.
But, these are similar flag, and is no effect for almost all drivers.
We avoided such checks.


Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/9 v3] mmc: tmio: fixup patches
  2014-07-22  5:30           ` Kuninori Morimoto
@ 2014-08-25  2:57             ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  2:57 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Chris, Ulf, Simon

These are v3 fixup patches for mmc tmio/shmobile.
I dropped [1/10] patch (which Ulf was pointed) from v2 patch-set.
We will post it again in the future,
but we want last 9 patches in upstream at this point.

Kuninori Morimoto (4):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
      mmc: tmio: ensure that the clock has been stopped before set_clock

Shinobu Uehara (5):
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 drivers/mmc/host/sh_mobile_sdhi.c |   24 ++++++++++++++++++++--
 drivers/mmc/host/tmio_mmc_dma.c   |    8 +++-----
 drivers/mmc/host/tmio_mmc_pio.c   |   40 ++++++++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h          |   22 ++++++++++++++++++++
 4 files changed, 84 insertions(+), 10 deletions(-)

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/9 v3] mmc: tmio: fixup patches
@ 2014-08-25  2:57             ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  2:57 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Chris, Ulf, Simon

These are v3 fixup patches for mmc tmio/shmobile.
I dropped [1/10] patch (which Ulf was pointed) from v2 patch-set.
We will post it again in the future,
but we want last 9 patches in upstream at this point.

Kuninori Morimoto (4):
      mmc: tmio: care about DMA tx/rx addr offset
      mmc: tmio: remove Renesas specific #ifdef
      mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
      mmc: tmio: ensure that the clock has been stopped before set_clock

Shinobu Uehara (5):
      mmc: tmio: clear error IRQ status
      mmc: tmio: control multiple block transfer mode
      mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
      mmc: tmio: check ILL_FUNC instead of CBSY
      mmc: tmio: add actual clock support as option

 drivers/mmc/host/sh_mobile_sdhi.c |   24 ++++++++++++++++++++--
 drivers/mmc/host/tmio_mmc_dma.c   |    8 +++-----
 drivers/mmc/host/tmio_mmc_pio.c   |   40 ++++++++++++++++++++++++++++++++++---
 include/linux/mfd/tmio.h          |   22 ++++++++++++++++++++
 4 files changed, 84 insertions(+), 10 deletions(-)

Best regards
---
Kuninori Morimoto

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

* [PATCH 1/9 v3] mmc: tmio: care about DMA tx/rx addr offset
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  2:58               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  2:58 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..1ccf49b 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index eb8f1d5..bd646b0 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -312,7 +312,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 1/9 v3] mmc: tmio: care about DMA tx/rx addr offset
@ 2014-08-25  2:58               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  2:58 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

Basically, SD_BUF0 Tx/Rx addresses are same
in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller
if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)

This patch adds new .dma_rx_offset and cares it

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    3 +++
 drivers/mmc/host/tmio_mmc_dma.c   |    2 +-
 include/linux/mfd/tmio.h          |    1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 91058da..1ccf49b 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {
 	unsigned long tmio_flags;
 	unsigned long capabilities;
 	unsigned long capabilities2;
+	dma_addr_t dma_rx_offset;
 };
 
 static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
 	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 	.capabilities2	= MMC_CAP2_NO_MULTI_READ,
+	.dma_rx_offset	= 0x2000,
 };
 
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 		mmc_data->flags |= of_data->tmio_flags;
 		mmc_data->capabilities |= of_data->capabilities;
 		mmc_data->capabilities2 |= of_data->capabilities2;
+		dma_priv->dma_rx_offset = of_data->dma_rx_offset;
 	}
 
 	/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index eb8f1d5..bd646b0 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -312,7 +312,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
 		if (pdata->dma->chan_priv_rx)
 			cfg.slave_id = pdata->dma->slave_id_rx;
 		cfg.direction = DMA_DEV_TO_MEM;
-		cfg.src_addr = cfg.dst_addr;
+		cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
 		cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 		cfg.dst_addr = 0;
 		ret = dmaengine_slave_config(host->chan_rx, &cfg);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 8f6f2e9..777e29b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {
 	int slave_id_tx;
 	int slave_id_rx;
 	int alignment_shift;
+	dma_addr_t dma_rx_offset;
 	bool (*filter)(struct dma_chan *chan, void *arg);
 };
 
-- 
1.7.9.5


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

* [PATCH 2/9 v3] mmc: tmio: clear error IRQ status
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  2:59               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  2:59 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 2/9 v3] mmc: tmio: clear error IRQ status
@ 2014-08-25  2:59               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  2:59 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Next card access will be always
error if it didn't clear error status

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924..c3b1b4e 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
 
 	pr_debug_status(*status);
 	pr_debug_status(*ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 }
 
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
-- 
1.7.9.5


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

* [PATCH 3/9 v3] mmc: tmio: control multiple block transfer mode
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:00               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:00 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 1ccf49b..d56ebd9 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode = SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 3/9 v3] mmc: tmio: control multiple block transfer mode
@ 2014-08-25  3:00               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:00 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas SDHI has "Multiple Block Transfer Mode" settings
on SD_CMD register which controls CMD12 automatically.

This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |   10 ++++++++++
 include/linux/mfd/tmio.h          |    6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 1ccf49b..d56ebd9 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
 
+	/*
+	 * All SDHI have CMD12 controll bit
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index c3b1b4e..1f1fdfb 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -44,6 +44,7 @@
 #include <linux/pm_qos.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)
 #define TRANSFER_READ  0x1000
 #define TRANSFER_MULTI 0x2000
 #define SECURITY_CMD   0x4000
+#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
 
 static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
 {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
 		if (data->blocks > 1) {
 			sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100);
 			c |= TRANSFER_MULTI;
+
+			/*
+			 * Disable auto CMD12 at IO_RW_EXTENDED when
+			 * multiple block transfer
+			 */
+			if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
+			    (cmd->opcode == SD_IO_RW_EXTENDED))
+				c |= NO_CMD12_ISSUE;
 		}
 		if (data->flags & MMC_DATA_READ)
 			c |= TRANSFER_READ;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 777e29b..7432d95 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -83,6 +83,12 @@
  */
 #define TMIO_MMC_HAVE_HIGH_REG		(1 << 6)
 
+/*
+ * Some controllers have CMD12 automatically
+ * issue/non-issue register
+ */
+#define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 4/9 v3] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:00               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:00 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index d56ebd9..42730d9 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 4/9 v3] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
@ 2014-08-25  3:00               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:00 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Renesas R-Car SDHI should set reserved bits
on CTL_SDIO_STATUS register when writing.
This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags
for this purpose

[Kuninori Morimoto: tidyuped for upstreaming
                    enabled this flags for all SH-Mobile/R-Car]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_pio.c   |    7 ++++++-
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index d56ebd9..42730d9 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
 
+	/*
+	 * All SDHI need SDIO_INFO1 reserved bit
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1f1fdfb..e51a993 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
 	unsigned int ireg, status;
+	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
 		return IRQ_HANDLED;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
 
-	sd_ctrl_write16(host, CTL_SDIO_STATUS, status & ~TMIO_SDIO_MASK_ALL);
+	sdio_status = status & ~TMIO_SDIO_MASK_ALL;
+	if (pdata->flags & TMIO_MMC_SDIO_STATUS_QUIRK)
+		sdio_status |= 6;
+
+	sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status);
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 7432d95..a7493ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -89,6 +89,11 @@
  */
 #define TMIO_MMC_HAVE_CMD12_CTRL	(1 << 7)
 
+/*
+ * Some controllers needs to set 1 on SDIO status reserved bits
+ */
+#define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 5/9 v3] mmc: tmio: check ILL_FUNC instead of CBSY
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:01               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:01 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 5/9 v3] mmc: tmio: check ILL_FUNC instead of CBSY
@ 2014-08-25  3:01               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:01 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controllers need to check SD bus status when writing data.
Then, it checks ILL_FUNC bit on SD_INFO2 register,
and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags.
Same method is required on tmio_mmc_data_irq() which will
be called after writing data.

Current driver is checking CBSY bit for this purpose,
but, some controllers doesn't have CBSY bit.
This patch checks ILL_FUNC bit instead of CBSY bit
if it has TMIO_MMC_HAS_IDLE_WAIT flags

[Kuninori Morimoto: tidyuped for upstreaming]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e51a993..b19d0cd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		goto out;
 
 	if (host->chan_tx && (data->flags & MMC_DATA_WRITE) && !host->force_pio) {
+		u32 status = sd_ctrl_read32(host, CTL_STATUS);
+		bool done = false;
+
 		/*
 		 * Has all data been written out yet? Testing on SuperH showed,
 		 * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)
 		 * DATAEND interrupt with the BUSY bit set, in this cases
 		 * waiting for one more interrupt fixes the problem.
 		 */
-		if (!(sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_CMD_BUSY)) {
+		if (host->pdata->flags & TMIO_MMC_HAS_IDLE_WAIT) {
+			if (status & TMIO_STAT_ILL_FUNC)
+				done = true;
+		} else {
+			if (!(status & TMIO_STAT_CMD_BUSY))
+				done = true;
+		}
+
+		if (done) {
 			tmio_mmc_disable_mmc_irqs(host, TMIO_STAT_DATAEND);
 			tasklet_schedule(&host->dma_complete);
 		}
-- 
1.7.9.5


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

* [PATCH 6/9 v3] mmc: tmio: remove Renesas specific #ifdef
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:01               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:01 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 42730d9..cd54ca8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index bd646b0..7d07738 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 6/9 v3] mmc: tmio: remove Renesas specific #ifdef
@ 2014-08-25  3:01               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:01 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag,
and remove Renesas specific #ifdef from tmio driver

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    5 +++++
 drivers/mmc/host/tmio_mmc_dma.c   |    6 ++----
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 42730d9..cd54ca8 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_SDIO_STATUS_QUIRK;
 
+	/*
+	 * All SDHI have DMA control register
+	 */
+	mmc_data->flags |= TMIO_MMC_HAVE_CTL_DMA_REG;
+
 	if (of_id && of_id->data) {
 		const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
 		mmc_data->flags |= of_data->tmio_flags;
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index bd646b0..7d07738 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
 	if (!host->chan_tx || !host->chan_rx)
 		return;
 
-#if defined(CONFIG_SUPERH) || defined(CONFIG_ARCH_SHMOBILE)
-	/* Switch DMA mode on or off - SuperH specific? */
-	sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
-#endif
+	if (host->pdata->flags & TMIO_MMC_HAVE_CTL_DMA_REG)
+		sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? 2 : 0);
 }
 
 void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index a7493ae..adcb0cd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -94,6 +94,11 @@
  */
 #define TMIO_MMC_SDIO_STATUS_QUIRK	(1 << 8)
 
+/*
+ * Some controllers have DMA enable/disable register
+ */
+#define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 7/9 v3] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:02               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:02 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 7/9 v3] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
@ 2014-08-25  3:02               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:02 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(),
and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index b19d0cd..da3c74d 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
-		clk |= 0x100;
 	}
 
 	if (host->set_clk_div)
-- 
1.7.9.5


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

* [PATCH 8/9 v3] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:02               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:02 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..1c5a631 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power = TMIO_MMC_OFF_STOP)
 			tmio_mmc_reset(host);
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		if (host->power = TMIO_MMC_OFF_STOP)
 			/* power up SD card and the bus */
-- 
1.7.9.5


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

* [PATCH 8/9 v3] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-08-25  3:02               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:02 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/tmio_mmc_pio.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index da3c74d..1c5a631 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power == TMIO_MMC_OFF_STOP)
 			tmio_mmc_reset(host);
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		if (host->power == TMIO_MMC_OFF_STOP)
 			/* power up SD card and the bus */
-- 
1.7.9.5


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

* [PATCH 9/9 v3] mmc: tmio: add actual clock support as option
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-25  3:03               ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:03 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0].
Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.

[Kuninori Morimoto: tidyuped for upstreaming]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    6 ++++--
 drivers/mmc/host/tmio_mmc_pio.c   |    5 +++++
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index cd54ca8..e55f761 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
+			  TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.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,
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1c5a631..895e713 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
+
+		/* 1/1 clock is option */
+		if ((host->pdata->flags & TMIO_MMC_CLK_ACTUAL) &&
+		    ((clk >> 22) & 0x1))
+			clk |= 0xff;
 	}
 
 	if (host->set_clk_div)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index adcb0cd..90436d5 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -99,6 +99,11 @@
  */
 #define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
 
+/*
+ * Some controllers allows to set SDx actual clock
+ */
+#define TMIO_MMC_CLK_ACTUAL		(1 << 10)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* [PATCH 9/9 v3] mmc: tmio: add actual clock support as option
@ 2014-08-25  3:03               ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  3:03 UTC (permalink / raw)
  To: Simon, Chris Ball, Ulf Hansson
  Cc: Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

From: Shinobu Uehara <shinobu.uehara.xc@renesas.com>

Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0].
Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.

[Kuninori Morimoto: tidyuped for upstreaming]

Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 drivers/mmc/host/sh_mobile_sdhi.c |    6 ++++--
 drivers/mmc/host/tmio_mmc_pio.c   |    5 +++++
 include/linux/mfd/tmio.h          |    5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index cd54ca8..e55f761 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE |
+			  TMIO_MMC_CLK_ACTUAL,
 	.capabilities	= MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
-	.tmio_flags	= TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
+	.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,
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 1c5a631..895e713 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 		for (clock = host->mmc->f_min, clk = 0x80000080;
 			new_clock >= (clock<<1); clk >>= 1)
 			clock <<= 1;
+
+		/* 1/1 clock is option */
+		if ((host->pdata->flags & TMIO_MMC_CLK_ACTUAL) &&
+		    ((clk >> 22) & 0x1))
+			clk |= 0xff;
 	}
 
 	if (host->set_clk_div)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index adcb0cd..90436d5 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -99,6 +99,11 @@
  */
 #define TMIO_MMC_HAVE_CTL_DMA_REG	(1 << 9)
 
+/*
+ * Some controllers allows to set SDx actual clock
+ */
+#define TMIO_MMC_CLK_ACTUAL		(1 << 10)
+
 int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
 int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
 void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
-- 
1.7.9.5


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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
  2014-08-25  0:53                   ` Kuninori Morimoto
@ 2014-08-25  8:50                     ` Ulf Hansson
  -1 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-25  8:50 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 25 August 2014 02:53, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
> Thank you for your feedback
>
>> > MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
>> > but, it is over-kill for this issue.
>> > This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
>> > when it was two blocks.
>> > This is additional option of MMC_CAP2_NO_MULTI_READ
>> >
>> > [Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
>> >
>> > Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
>> > Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>> > Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> > ---
>> >  arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
>> >  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>>
>> I prefer to split up patches into ARM patches and MMC patches if it's possible.
>> That makes it easier to review and collect acks from SoC maintainers.
>
> I see. will do
>
>> > @@ -331,7 +331,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>>
>> Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from
>> platform data. If this is HW bug, aren't that related to the actual
>> mmc controller and version of it - not the board/platform?
>
> In historical reason, your idea can be implemented on DT case.
> But above style is very normal for non-DT case in this driver...
>
>> This applies to more caps and boards further down below in this patch as well.
>>
>> To me, it seems like these belongs into the host driver instead!?
>
> This issue is similar to MMC_CAP2_NO_MULTI_READ,
> and it is located in block.c.
> So, we added it there too.
>
> If you can't accept it, we will consider it again.
> But is it possilbe to keep consistency if host side exchange block size
> without using framework ??

Nope, we need adaptations to the framework and I have no objections to that.

>
>> > @@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>> >
>> >                 /* 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;
>> > +                   rq_data_dir(req) = READ) {
>> > +
>> > +                       if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
>>
>> This conforms to what the commit message states, that
>> MMC_CAP2_2BLKS_LIMIT needs to be used together with
>> MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have
>> them separate.
>>
>> Anyway, according to your cap configuration changes, you are replacing
>> MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding
>> it...
>
> Because this method will check caps2 flag twice for
> MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case.
> But, these are similar flag, and is no effect for almost all drivers.
> We avoided such checks.

I see, but I don't think such "optimization" is worth much. To me it
just adds a bit of confusion. I would prefer to have them separate.

Kind regards
Uffe

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
@ 2014-08-25  8:50                     ` Ulf Hansson
  0 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-25  8:50 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 25 August 2014 02:53, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Ulf
>
> Thank you for your feedback
>
>> > MMC_CAP2_NO_MULTI_READ flags disable all multiple block read,
>> > but, it is over-kill for this issue.
>> > This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read
>> > when it was two blocks.
>> > This is additional option of MMC_CAP2_NO_MULTI_READ
>> >
>> > [Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
>> >
>> > Tested-by: Nguyen Xuan Nui <nx-nui@jinso.co.jp>
>> > Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>> > Signed-off-by: Shinobu Uehara <shinobu.uehara.xc@renesas.com>
>> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> > ---
>> >  arch/arm/mach-shmobile/board-koelsch.c |    6 +++---
>> >  arch/arm/mach-shmobile/board-lager.c   |    4 ++--
>>
>> I prefer to split up patches into ARM patches and MMC patches if it's possible.
>> That makes it easier to review and collect acks from SoC maintainers.
>
> I see. will do
>
>> > @@ -331,7 +331,7 @@ 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_caps2     = MMC_CAP2_NO_2BLKS_READ,
>>
>> Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from
>> platform data. If this is HW bug, aren't that related to the actual
>> mmc controller and version of it - not the board/platform?
>
> In historical reason, your idea can be implemented on DT case.
> But above style is very normal for non-DT case in this driver...
>
>> This applies to more caps and boards further down below in this patch as well.
>>
>> To me, it seems like these belongs into the host driver instead!?
>
> This issue is similar to MMC_CAP2_NO_MULTI_READ,
> and it is located in block.c.
> So, we added it there too.
>
> If you can't accept it, we will consider it again.
> But is it possilbe to keep consistency if host side exchange block size
> without using framework ??

Nope, we need adaptations to the framework and I have no objections to that.

>
>> > @@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>> >
>> >                 /* 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;
>> > +                   rq_data_dir(req) == READ) {
>> > +
>> > +                       if (card->host->caps2 & MMC_CAP2_2BLKS_LIMIT) {
>>
>> This conforms to what the commit message states, that
>> MMC_CAP2_2BLKS_LIMIT needs to be used together with
>> MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have
>> them separate.
>>
>> Anyway, according to your cap configuration changes, you are replacing
>> MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding
>> it...
>
> Because this method will check caps2 flag twice for
> MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case.
> But, these are similar flag, and is no effect for almost all drivers.
> We avoided such checks.

I see, but I don't think such "optimization" is worth much. To me it
just adds a bit of confusion. I would prefer to have them separate.

Kind regards
Uffe

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
  2014-08-25  8:50                     ` Ulf Hansson
@ 2014-08-25  9:59                       ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  9:59 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Ulf

Thank you for your feedback

> > If you can't accept it, we will consider it again.
> > But is it possilbe to keep consistency if host side exchange block size
> > without using framework ??
> 
> Nope, we need adaptations to the framework and I have no objections to that.

Thank you.
Basically, I agree with your opinion (= it locals to host driver side, not on framework)
but, I couldn't find good method for it
(the size is decided on framework, and it seems host side driver can't do something to it)
And, we noticed similar flag.
But, hmm... if we can have callback function on framework...

/*
 * this can replace MMC_CAP2_NO_MULTI_READ ?
 */
void no_multi_read_fixup(struct mmc_blk_request *brq,
                         struct request *req)
{
        if (rq_data_dir(req) = READ)
             brq->data.blocks = 1;
}

/*
 * we can use this instead of MMC_CAP2_2BLKS_LIMIT ?
 */
void two_block_limit_read_fixup(struct mmc_blk_request *brq,
                                struct request *req)
{
        if ((rq_data_dir(req) = READ) && 
            (brq->data.blocks = 2))
                brq->data.blocks = 1;
}

static void mmc_blk_rw_rq_prep(xxxx)
{
        ...
        if (brq->data.blocks > 1) {
              ...

              if (card->host->host_data_fixup)
                     card->host->host_data_fixup(brq, req)
        }
        ...
}

> > Because this method will check caps2 flag twice for
> > MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case.
> > But, these are similar flag, and is no effect for almost all drivers.
> > We avoided such checks.
> 
> I see, but I don't think such "optimization" is worth much. To me it
> just adds a bit of confusion. I would prefer to have them separate.

OK, I see.
I already posted v3 patch-set which doesn't have this patch.
I will post v3 of this patch if above v3 patch-set were accepted.

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
@ 2014-08-25  9:59                       ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-25  9:59 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Ulf

Thank you for your feedback

> > If you can't accept it, we will consider it again.
> > But is it possilbe to keep consistency if host side exchange block size
> > without using framework ??
> 
> Nope, we need adaptations to the framework and I have no objections to that.

Thank you.
Basically, I agree with your opinion (= it locals to host driver side, not on framework)
but, I couldn't find good method for it
(the size is decided on framework, and it seems host side driver can't do something to it)
And, we noticed similar flag.
But, hmm... if we can have callback function on framework...

/*
 * this can replace MMC_CAP2_NO_MULTI_READ ?
 */
void no_multi_read_fixup(struct mmc_blk_request *brq,
                         struct request *req)
{
        if (rq_data_dir(req) == READ)
             brq->data.blocks = 1;
}

/*
 * we can use this instead of MMC_CAP2_2BLKS_LIMIT ?
 */
void two_block_limit_read_fixup(struct mmc_blk_request *brq,
                                struct request *req)
{
        if ((rq_data_dir(req) == READ) && 
            (brq->data.blocks == 2))
                brq->data.blocks = 1;
}

static void mmc_blk_rw_rq_prep(xxxx)
{
        ...
        if (brq->data.blocks > 1) {
              ...

              if (card->host->host_data_fixup)
                     card->host->host_data_fixup(brq, req)
        }
        ...
}

> > Because this method will check caps2 flag twice for
> > MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case.
> > But, these are similar flag, and is no effect for almost all drivers.
> > We avoided such checks.
> 
> I see, but I don't think such "optimization" is worth much. To me it
> just adds a bit of confusion. I would prefer to have them separate.

OK, I see.
I already posted v3 patch-set which doesn't have this patch.
I will post v3 of this patch if above v3 patch-set were accepted.

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
  2014-08-25  9:59                       ` Kuninori Morimoto
@ 2014-08-27  1:37                         ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-27  1:37 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Simon, Chris Ball, Ian Molton, Morimoto, Magnus,
	Linux-SH, linux-mmc


Hi Ulf again

What do you think this idea ?
We can move MMC_CAP2_NO_MULTI_READ from host.h to driver side

> /*
>  * this can replace MMC_CAP2_NO_MULTI_READ ?
>  */
> void no_multi_read_fixup(struct mmc_blk_request *brq,
>                          struct request *req)
> {
>         if (rq_data_dir(req) = READ)
>              brq->data.blocks = 1;
> }
> 
> /*
>  * we can use this instead of MMC_CAP2_2BLKS_LIMIT ?
>  */
> void two_block_limit_read_fixup(struct mmc_blk_request *brq,
>                                 struct request *req)
> {
>         if ((rq_data_dir(req) = READ) && 
>             (brq->data.blocks = 2))
>                 brq->data.blocks = 1;
> }
> 
> static void mmc_blk_rw_rq_prep(xxxx)
> {
>         ...
>         if (brq->data.blocks > 1) {
>               ...
> 
>               if (card->host->host_data_fixup)
>                      card->host->host_data_fixup(brq, req)
>         }
>         ...
> }

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
@ 2014-08-27  1:37                         ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-27  1:37 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Ulf Hansson, Simon, Chris Ball, Ian Molton, Morimoto, Magnus,
	Linux-SH, linux-mmc


Hi Ulf again

What do you think this idea ?
We can move MMC_CAP2_NO_MULTI_READ from host.h to driver side

> /*
>  * this can replace MMC_CAP2_NO_MULTI_READ ?
>  */
> void no_multi_read_fixup(struct mmc_blk_request *brq,
>                          struct request *req)
> {
>         if (rq_data_dir(req) == READ)
>              brq->data.blocks = 1;
> }
> 
> /*
>  * we can use this instead of MMC_CAP2_2BLKS_LIMIT ?
>  */
> void two_block_limit_read_fixup(struct mmc_blk_request *brq,
>                                 struct request *req)
> {
>         if ((rq_data_dir(req) == READ) && 
>             (brq->data.blocks == 2))
>                 brq->data.blocks = 1;
> }
> 
> static void mmc_blk_rw_rq_prep(xxxx)
> {
>         ...
>         if (brq->data.blocks > 1) {
>               ...
> 
>               if (card->host->host_data_fixup)
>                      card->host->host_data_fixup(brq, req)
>         }
>         ...
> }

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH 0/9 v3] mmc: tmio: fixup patches
  2014-08-25  2:57             ` Kuninori Morimoto
@ 2014-08-27 13:11               ` Ulf Hansson
  -1 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-27 13:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 25 August 2014 04:57, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Chris, Ulf, Simon
>
> These are v3 fixup patches for mmc tmio/shmobile.
> I dropped [1/10] patch (which Ulf was pointed) from v2 patch-set.
> We will post it again in the future,
> but we want last 9 patches in upstream at this point.

Thanks Kuninori and Shinobu!

I have applied all patches but "mmc: tmio: ensure that the clock has
been stopped before set_clock".

Since I decided to apply my own tmio patchset prior this series, the
above patch needs to be re-based, if needed at all. Could you please
have a look and send and possibly send a new version.

Kind regards
Uffe

>
> Kuninori Morimoto (4):
>       mmc: tmio: care about DMA tx/rx addr offset
>       mmc: tmio: remove Renesas specific #ifdef
>       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>       mmc: tmio: ensure that the clock has been stopped before set_clock
>
> Shinobu Uehara (5):
>       mmc: tmio: clear error IRQ status
>       mmc: tmio: control multiple block transfer mode
>       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>       mmc: tmio: check ILL_FUNC instead of CBSY
>       mmc: tmio: add actual clock support as option
>
>  drivers/mmc/host/sh_mobile_sdhi.c |   24 ++++++++++++++++++++--
>  drivers/mmc/host/tmio_mmc_dma.c   |    8 +++-----
>  drivers/mmc/host/tmio_mmc_pio.c   |   40 ++++++++++++++++++++++++++++++++++---
>  include/linux/mfd/tmio.h          |   22 ++++++++++++++++++++
>  4 files changed, 84 insertions(+), 10 deletions(-)
>
> Best regards
> ---
> Kuninori Morimoto

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

* Re: [PATCH 0/9 v3] mmc: tmio: fixup patches
@ 2014-08-27 13:11               ` Ulf Hansson
  0 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-27 13:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 25 August 2014 04:57, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
>
> Hi Chris, Ulf, Simon
>
> These are v3 fixup patches for mmc tmio/shmobile.
> I dropped [1/10] patch (which Ulf was pointed) from v2 patch-set.
> We will post it again in the future,
> but we want last 9 patches in upstream at this point.

Thanks Kuninori and Shinobu!

I have applied all patches but "mmc: tmio: ensure that the clock has
been stopped before set_clock".

Since I decided to apply my own tmio patchset prior this series, the
above patch needs to be re-based, if needed at all. Could you please
have a look and send and possibly send a new version.

Kind regards
Uffe

>
> Kuninori Morimoto (4):
>       mmc: tmio: care about DMA tx/rx addr offset
>       mmc: tmio: remove Renesas specific #ifdef
>       mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
>       mmc: tmio: ensure that the clock has been stopped before set_clock
>
> Shinobu Uehara (5):
>       mmc: tmio: clear error IRQ status
>       mmc: tmio: control multiple block transfer mode
>       mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
>       mmc: tmio: check ILL_FUNC instead of CBSY
>       mmc: tmio: add actual clock support as option
>
>  drivers/mmc/host/sh_mobile_sdhi.c |   24 ++++++++++++++++++++--
>  drivers/mmc/host/tmio_mmc_dma.c   |    8 +++-----
>  drivers/mmc/host/tmio_mmc_pio.c   |   40 ++++++++++++++++++++++++++++++++++---
>  include/linux/mfd/tmio.h          |   22 ++++++++++++++++++++
>  4 files changed, 84 insertions(+), 10 deletions(-)
>
> Best regards
> ---
> Kuninori Morimoto

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

* [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-08-27 13:11               ` Ulf Hansson
@ 2014-08-28  2:24                 ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-28  2:24 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

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

 - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next

 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..7289331 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		tmio_mmc_clk_stop(host);
 		break;
 	case MMC_POWER_UP:
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		tmio_mmc_power_on(host, ios->vdd);
 		tmio_mmc_clk_start(host);
 		tmio_mmc_set_bus_width(host, ios->bus_width);
 		break;
 	case MMC_POWER_ON:
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		tmio_mmc_clk_start(host);
 		tmio_mmc_set_bus_width(host, ios->bus_width);
@@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
 	tmio_mmc_clk_update(host);
 
 	if (host->clk_cache) {
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, host->clk_cache);
 		tmio_mmc_clk_start(host);
 	}
-- 
1.7.9.5


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

* [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-08-28  2:24                 ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-28  2:24 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

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

This patch ensures that the clock has been stopped before
it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch

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

 - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next

 drivers/mmc/host/tmio_mmc_pio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index ba45413..7289331 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		tmio_mmc_clk_stop(host);
 		break;
 	case MMC_POWER_UP:
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		tmio_mmc_power_on(host, ios->vdd);
 		tmio_mmc_clk_start(host);
 		tmio_mmc_set_bus_width(host, ios->bus_width);
 		break;
 	case MMC_POWER_ON:
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, ios->clock);
 		tmio_mmc_clk_start(host);
 		tmio_mmc_set_bus_width(host, ios->bus_width);
@@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
 	tmio_mmc_clk_update(host);
 
 	if (host->clk_cache) {
+		tmio_mmc_clk_stop(host);
 		tmio_mmc_set_clock(host, host->clk_cache);
 		tmio_mmc_clk_start(host);
 	}
-- 
1.7.9.5


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

* Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-08-28  2:24                 ` Kuninori Morimoto
@ 2014-08-28  7:11                   ` Ulf Hansson
  -1 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-28  7:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 28 August 2014 04:24, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> This patch ensures that the clock has been stopped before
> it calls tmio_mmc_set_clock().
> The clock settings might be failed without this patch
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v3 -> v4
>
>  - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next
>
>  drivers/mmc/host/tmio_mmc_pio.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..7289331 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>                 tmio_mmc_clk_stop(host);
>                 break;
>         case MMC_POWER_UP:
> +               tmio_mmc_clk_stop(host);

I don't think this is needed. Let me elaborate on why.

There two scenarios for when you may come down this path.

Either after ->probe() or after a MMC_POWER_OFF has been handled. In
both scenarios, tmio_mmc_clk_stop(host) has already been invoked.

Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then
tmio_mmc_reset(), should those maybe be done in reverse order to make
sure the clock is stopped?

>                 tmio_mmc_set_clock(host, ios->clock);
>                 tmio_mmc_power_on(host, ios->vdd);
>                 tmio_mmc_clk_start(host);
>                 tmio_mmc_set_bus_width(host, ios->bus_width);
>                 break;
>         case MMC_POWER_ON:
> +               tmio_mmc_clk_stop(host);
>                 tmio_mmc_set_clock(host, ios->clock);
>                 tmio_mmc_clk_start(host);
>                 tmio_mmc_set_bus_width(host, ios->bus_width);
> @@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
>         tmio_mmc_clk_update(host);
>
>         if (host->clk_cache) {
> +               tmio_mmc_clk_stop(host);

This should also not be needed.

To get runtime PM resumed, you must first be runtime PM suspended. In
the runtime PM suspend callback we have already invoked
tmio_mmc_set_clock().

Well, again it may depend on if tmio_mmc_reset() should be followed by
a tmio_mmc_clk_stop(), which isn't the case right now.

>                 tmio_mmc_set_clock(host, host->clk_cache);
>                 tmio_mmc_clk_start(host);
>         }
> --
> 1.7.9.5
>

Finally, another question - somewhat related to clocks but not so much
to this patch.

Shouldn't tmio_mmc_set_clock() when requested rate is 0, actually
invoke tmio_mmc_clk_stop()? How will otherwise the clock be stopped?

Kind regards
Uffe

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

* Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-08-28  7:11                   ` Ulf Hansson
  0 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-28  7:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 28 August 2014 04:24, Kuninori Morimoto
<kuninori.morimoto.gx@gmail.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> This patch ensures that the clock has been stopped before
> it calls tmio_mmc_set_clock().
> The clock settings might be failed without this patch
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v3 -> v4
>
>  - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next
>
>  drivers/mmc/host/tmio_mmc_pio.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index ba45413..7289331 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>                 tmio_mmc_clk_stop(host);
>                 break;
>         case MMC_POWER_UP:
> +               tmio_mmc_clk_stop(host);

I don't think this is needed. Let me elaborate on why.

There two scenarios for when you may come down this path.

Either after ->probe() or after a MMC_POWER_OFF has been handled. In
both scenarios, tmio_mmc_clk_stop(host) has already been invoked.

Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then
tmio_mmc_reset(), should those maybe be done in reverse order to make
sure the clock is stopped?

>                 tmio_mmc_set_clock(host, ios->clock);
>                 tmio_mmc_power_on(host, ios->vdd);
>                 tmio_mmc_clk_start(host);
>                 tmio_mmc_set_bus_width(host, ios->bus_width);
>                 break;
>         case MMC_POWER_ON:
> +               tmio_mmc_clk_stop(host);
>                 tmio_mmc_set_clock(host, ios->clock);
>                 tmio_mmc_clk_start(host);
>                 tmio_mmc_set_bus_width(host, ios->bus_width);
> @@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
>         tmio_mmc_clk_update(host);
>
>         if (host->clk_cache) {
> +               tmio_mmc_clk_stop(host);

This should also not be needed.

To get runtime PM resumed, you must first be runtime PM suspended. In
the runtime PM suspend callback we have already invoked
tmio_mmc_set_clock().

Well, again it may depend on if tmio_mmc_reset() should be followed by
a tmio_mmc_clk_stop(), which isn't the case right now.

>                 tmio_mmc_set_clock(host, host->clk_cache);
>                 tmio_mmc_clk_start(host);
>         }
> --
> 1.7.9.5
>

Finally, another question - somewhat related to clocks but not so much
to this patch.

Shouldn't tmio_mmc_set_clock() when requested rate is 0, actually
invoke tmio_mmc_clk_stop()? How will otherwise the clock be stopped?

Kind regards
Uffe

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

* Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-08-28  7:11                   ` Ulf Hansson
@ 2014-08-28  7:13                     ` Ulf Hansson
  -1 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-28  7:13 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 28 August 2014 09:11, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 28 August 2014 04:24, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>
>> This patch ensures that the clock has been stopped before
>> it calls tmio_mmc_set_clock().
>> The clock settings might be failed without this patch
>>
>> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> ---
>> v3 -> v4
>>
>>  - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next
>>
>>  drivers/mmc/host/tmio_mmc_pio.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
>> index ba45413..7289331 100644
>> --- a/drivers/mmc/host/tmio_mmc_pio.c
>> +++ b/drivers/mmc/host/tmio_mmc_pio.c
>> @@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>                 tmio_mmc_clk_stop(host);
>>                 break;
>>         case MMC_POWER_UP:
>> +               tmio_mmc_clk_stop(host);
>
> I don't think this is needed. Let me elaborate on why.
>
> There two scenarios for when you may come down this path.
>
> Either after ->probe() or after a MMC_POWER_OFF has been handled. In
> both scenarios, tmio_mmc_clk_stop(host) has already been invoked.
>
> Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then
> tmio_mmc_reset(), should those maybe be done in reverse order to make
> sure the clock is stopped?
>
>>                 tmio_mmc_set_clock(host, ios->clock);
>>                 tmio_mmc_power_on(host, ios->vdd);
>>                 tmio_mmc_clk_start(host);
>>                 tmio_mmc_set_bus_width(host, ios->bus_width);
>>                 break;
>>         case MMC_POWER_ON:
>> +               tmio_mmc_clk_stop(host);
>>                 tmio_mmc_set_clock(host, ios->clock);
>>                 tmio_mmc_clk_start(host);
>>                 tmio_mmc_set_bus_width(host, ios->bus_width);
>> @@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
>>         tmio_mmc_clk_update(host);
>>
>>         if (host->clk_cache) {
>> +               tmio_mmc_clk_stop(host);
>
> This should also not be needed.
>
> To get runtime PM resumed, you must first be runtime PM suspended. In
> the runtime PM suspend callback we have already invoked
> tmio_mmc_set_clock().

/s /tmio_mmc_set_clock() / tmio_mmc_clk_stop()

>
> Well, again it may depend on if tmio_mmc_reset() should be followed by
> a tmio_mmc_clk_stop(), which isn't the case right now.
>
>>                 tmio_mmc_set_clock(host, host->clk_cache);
>>                 tmio_mmc_clk_start(host);
>>         }
>> --
>> 1.7.9.5
>>
>
> Finally, another question - somewhat related to clocks but not so much
> to this patch.
>
> Shouldn't tmio_mmc_set_clock() when requested rate is 0, actually
> invoke tmio_mmc_clk_stop()? How will otherwise the clock be stopped?
>
> Kind regards
> Uffe

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

* Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-08-28  7:13                     ` Ulf Hansson
  0 siblings, 0 replies; 152+ messages in thread
From: Ulf Hansson @ 2014-08-28  7:13 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc

On 28 August 2014 09:11, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 28 August 2014 04:24, Kuninori Morimoto
> <kuninori.morimoto.gx@gmail.com> wrote:
>> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>>
>> This patch ensures that the clock has been stopped before
>> it calls tmio_mmc_set_clock().
>> The clock settings might be failed without this patch
>>
>> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>> ---
>> v3 -> v4
>>
>>  - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next
>>
>>  drivers/mmc/host/tmio_mmc_pio.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
>> index ba45413..7289331 100644
>> --- a/drivers/mmc/host/tmio_mmc_pio.c
>> +++ b/drivers/mmc/host/tmio_mmc_pio.c
>> @@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>>                 tmio_mmc_clk_stop(host);
>>                 break;
>>         case MMC_POWER_UP:
>> +               tmio_mmc_clk_stop(host);
>
> I don't think this is needed. Let me elaborate on why.
>
> There two scenarios for when you may come down this path.
>
> Either after ->probe() or after a MMC_POWER_OFF has been handled. In
> both scenarios, tmio_mmc_clk_stop(host) has already been invoked.
>
> Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then
> tmio_mmc_reset(), should those maybe be done in reverse order to make
> sure the clock is stopped?
>
>>                 tmio_mmc_set_clock(host, ios->clock);
>>                 tmio_mmc_power_on(host, ios->vdd);
>>                 tmio_mmc_clk_start(host);
>>                 tmio_mmc_set_bus_width(host, ios->bus_width);
>>                 break;
>>         case MMC_POWER_ON:
>> +               tmio_mmc_clk_stop(host);
>>                 tmio_mmc_set_clock(host, ios->clock);
>>                 tmio_mmc_clk_start(host);
>>                 tmio_mmc_set_bus_width(host, ios->bus_width);
>> @@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
>>         tmio_mmc_clk_update(host);
>>
>>         if (host->clk_cache) {
>> +               tmio_mmc_clk_stop(host);
>
> This should also not be needed.
>
> To get runtime PM resumed, you must first be runtime PM suspended. In
> the runtime PM suspend callback we have already invoked
> tmio_mmc_set_clock().

/s /tmio_mmc_set_clock() / tmio_mmc_clk_stop()

>
> Well, again it may depend on if tmio_mmc_reset() should be followed by
> a tmio_mmc_clk_stop(), which isn't the case right now.
>
>>                 tmio_mmc_set_clock(host, host->clk_cache);
>>                 tmio_mmc_clk_start(host);
>>         }
>> --
>> 1.7.9.5
>>
>
> Finally, another question - somewhat related to clocks but not so much
> to this patch.
>
> Shouldn't tmio_mmc_set_clock() when requested rate is 0, actually
> invoke tmio_mmc_clk_stop()? How will otherwise the clock be stopped?
>
> Kind regards
> Uffe

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

* Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
  2014-08-28  7:13                     ` Ulf Hansson
@ 2014-08-28 10:36                       ` Kuninori Morimoto
  -1 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-28 10:36 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Ulf

> > I don't think this is needed. Let me elaborate on why.
> >
> > There two scenarios for when you may come down this path.
> >
> > Either after ->probe() or after a MMC_POWER_OFF has been handled. In
> > both scenarios, tmio_mmc_clk_stop(host) has already been invoked.
> >
> > Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then
> > tmio_mmc_reset(), should those maybe be done in reverse order to make
> > sure the clock is stopped?
(snip)
> > To get runtime PM resumed, you must first be runtime PM suspended. In
> > the runtime PM suspend callback we have already invoked
> > tmio_mmc_set_clock().

I see
Thank you for you detail explain about that

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
@ 2014-08-28 10:36                       ` Kuninori Morimoto
  0 siblings, 0 replies; 152+ messages in thread
From: Kuninori Morimoto @ 2014-08-28 10:36 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Simon, Chris Ball, Ian Molton, Morimoto, Magnus, Linux-SH, linux-mmc


Hi Ulf

> > I don't think this is needed. Let me elaborate on why.
> >
> > There two scenarios for when you may come down this path.
> >
> > Either after ->probe() or after a MMC_POWER_OFF has been handled. In
> > both scenarios, tmio_mmc_clk_stop(host) has already been invoked.
> >
> > Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then
> > tmio_mmc_reset(), should those maybe be done in reverse order to make
> > sure the clock is stopped?
(snip)
> > To get runtime PM resumed, you must first be runtime PM suspended. In
> > the runtime PM suspend callback we have already invoked
> > tmio_mmc_set_clock().

I see
Thank you for you detail explain about that

Best regards
---
Kuninori Morimoto

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

end of thread, other threads:[~2014-08-28 10:36 UTC | newest]

Thread overview: 152+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <d3d6aa34548248768494ad88056cf4bd@SINPR06MB105.apcprd06.prod.outlook.com>
     [not found] ` <87simtenpi.wl%kuninori.morimoto.gx@renesas.com>
     [not found]   ` <cb608c5e763f47b597936724ec05b615@SINPR06MB105.apcprd06.prod.outlook.com>
     [not found]     ` <87pphxe2q0.wl%kuninori.morimoto.gx@renesas.com>
     [not found]       ` <53AD638C.5060907@renesas.com>
2014-07-22  5:30         ` [PATCH 0/10][RFC] mmc: tmio: fixup patches Kuninori Morimoto
2014-07-22  5:30           ` Kuninori Morimoto
2014-07-22  5:33           ` [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check Kuninori Morimoto
2014-07-22  5:33             ` Kuninori Morimoto
2014-07-22 12:39             ` Sergei Shtylyov
2014-07-22 12:39               ` Sergei Shtylyov
2014-07-22 23:51               ` Kuninori Morimoto
2014-07-22 23:51                 ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 02/10] mmc: block: add block number limitation flag for multiple block read Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 03/10] mmc: tmio: care about DMA tx/rx addr offset Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 04/10] mmc: tmio: clear error IRQ status Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 05/10] mmc: tmio: control multiple block transfer mode Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 06/10] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 07/10] mmc: tmio: check ILL_FUNC instead of CBSY Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:34           ` [PATCH 08/10] mmc: tmio: remove Renesas specific #ifdef Kuninori Morimoto
2014-07-22  5:34             ` Kuninori Morimoto
2014-07-22  5:35           ` [PATCH 09/10] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock() Kuninori Morimoto
2014-07-22  5:35             ` Kuninori Morimoto
2014-07-22  5:35           ` [PATCH 10/10] mmc: tmio: add actual clock support as option Kuninori Morimoto
2014-07-22  5:35             ` Kuninori Morimoto
2014-07-29  8:42           ` [PATCH 0/10 v2] mmc: tmio: fixup patches Kuninori Morimoto
2014-07-29  8:42             ` Kuninori Morimoto
2014-07-29  8:44             ` [PATCH 01/10 v2] mmc: block: add block number limitation flag for multiple block read Kuninori Morimoto
2014-07-29  8:44               ` Kuninori Morimoto
2014-07-31  6:14               ` [Bug] mmc: MMC and SDHI has a kernel panic error when transfer data カオ ミン ヒェップ
2014-07-31  6:14                 ` カオ ミン ヒェップ
2014-07-29  8:44             ` [PATCH 02/10 v2] mmc: tmio: care about DMA tx/rx addr offset Kuninori Morimoto
2014-07-29  8:44               ` Kuninori Morimoto
2014-07-29  8:44             ` [PATCH 03/10 v2] mmc: tmio: clear error IRQ status Kuninori Morimoto
2014-07-29  8:44               ` Kuninori Morimoto
2014-07-29  8:45             ` [PATCH 04/10 v2] mmc: tmio: control multiple block transfer mode Kuninori Morimoto
2014-07-29  8:45               ` Kuninori Morimoto
2014-07-29  8:45             ` [PATCH 05/10 v2] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK Kuninori Morimoto
2014-07-29  8:45               ` Kuninori Morimoto
2014-07-29  8:46             ` [PATCH 06/10 v2] mmc: tmio: check ILL_FUNC instead of CBSY Kuninori Morimoto
2014-07-29  8:46               ` Kuninori Morimoto
2014-07-29  8:46             ` [PATCH 07/10 v2] mmc: tmio: remove Renesas specific #ifdef Kuninori Morimoto
2014-07-29  8:46               ` Kuninori Morimoto
2014-07-29  8:47             ` [PATCH 08/10 v2] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock() Kuninori Morimoto
2014-07-29  8:47               ` Kuninori Morimoto
2014-07-29  8:47             ` [PATCH 09/10 v2] mmc: tmio: ensure that the clock has been stopped before set_clock Kuninori Morimoto
2014-07-29  8:47               ` Kuninori Morimoto
2014-07-29  8:47             ` [PATCH 10/10 v2] mmc: tmio: add actual clock support as option Kuninori Morimoto
2014-07-29  8:47               ` Kuninori Morimoto
2014-07-30  0:45             ` [PATCH 0/10 v2] mmc: tmio: fixup patches Simon Horman
2014-07-30  0:45               ` Simon Horman
2014-07-31  1:52             ` カオ ミン ヒェップ
2014-07-31  1:52               ` カオ ミン ヒェップ
2014-07-31  2:30               ` Simon Horman
2014-07-31  2:30                 ` Simon Horman
2014-07-31  4:27                 ` カオ ミン ヒェップ
2014-07-31  4:27                   ` カオ ミン ヒェップ
2014-07-31  4:30                   ` Simon Horman
2014-07-31  4:30                     ` Simon Horman
2014-07-31  4:34                   ` Kuninori Morimoto
2014-07-31  4:34                     ` Kuninori Morimoto
2014-07-31  5:05                     ` カオ ミン ヒェップ
2014-07-31  5:05                       ` カオ ミン ヒェップ
2014-08-05  3:16             ` [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible Kuninori Morimoto
2014-08-05  3:16               ` Kuninori Morimoto
2014-08-05  6:59               ` Geert Uytterhoeven
2014-08-05  6:59                 ` Geert Uytterhoeven
2014-08-05 23:45                 ` Kuninori Morimoto
2014-08-05 23:45                   ` Kuninori Morimoto
2014-08-05  3:17             ` [PATCH 2/5] ARM: shmobile: r8a7778: add generation level compatible for SDHI Kuninori Morimoto
2014-08-05  3:17               ` Kuninori Morimoto
2014-08-05  3:17             ` [PATCH 3/5] ARM: shmobile: r8a7779: " Kuninori Morimoto
2014-08-05  3:17               ` Kuninori Morimoto
2014-08-05  3:17             ` [PATCH 4/5] ARM: shmobile: r8a7790: " Kuninori Morimoto
2014-08-05  3:17               ` Kuninori Morimoto
2014-08-05  3:17             ` [PATCH 5/5] ARM: shmobile: r8a7791: " Kuninori Morimoto
2014-08-05  3:17               ` Kuninori Morimoto
2014-08-06  1:47             ` [PATCH 0/5 v2] mmc: shmobile: adds generatoin level DT compatible Kuninori Morimoto
2014-08-06  1:47               ` Kuninori Morimoto
2014-08-06  1:48               ` [PATCH 1/5 v2] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in " Kuninori Morimoto
2014-08-06  1:48                 ` Kuninori Morimoto
2014-08-07  0:43                 ` Simon Horman
2014-08-07  0:43                   ` Simon Horman
2014-08-06  1:49               ` [PATCH 2/5 v2] ARM: shmobile: r8a7778: add generation level compatible for SDHI Kuninori Morimoto
2014-08-06  1:49                 ` Kuninori Morimoto
2014-08-06  1:49               ` [PATCH 3/5 v2] ARM: shmobile: r8a7779: " Kuninori Morimoto
2014-08-06  1:49                 ` Kuninori Morimoto
2014-08-06  1:49               ` [PATCH 4/5 v2] ARM: shmobile: r8a7790: " Kuninori Morimoto
2014-08-06  1:49                 ` Kuninori Morimoto
2014-08-06  1:50               ` [PATCH 5/5 v2] ARM: shmobile: r8a7791: " Kuninori Morimoto
2014-08-06  1:50                 ` Kuninori Morimoto
2014-08-22  8:35           ` [PATCH 0/10 v2 resend] mmc: tmio: fixup patches Kuninori Morimoto
2014-08-22  8:35             ` Kuninori Morimoto
2014-08-22  8:36             ` [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read Kuninori Morimoto
2014-08-22  8:36               ` Kuninori Morimoto
2014-08-22 10:31               ` Ulf Hansson
2014-08-22 10:31                 ` Ulf Hansson
2014-08-25  0:53                 ` Kuninori Morimoto
2014-08-25  0:53                   ` Kuninori Morimoto
2014-08-25  8:50                   ` Ulf Hansson
2014-08-25  8:50                     ` Ulf Hansson
2014-08-25  9:59                     ` Kuninori Morimoto
2014-08-25  9:59                       ` Kuninori Morimoto
2014-08-27  1:37                       ` Kuninori Morimoto
2014-08-27  1:37                         ` Kuninori Morimoto
2014-08-22  8:37             ` [PATCH 02/10 v2 resend] mmc: tmio: care about DMA tx/rx addr offset Kuninori Morimoto
2014-08-22  8:37               ` Kuninori Morimoto
2014-08-22  8:38             ` [PATCH 03/10 v2 resend] mmc: tmio: clear error IRQ status Kuninori Morimoto
2014-08-22  8:38               ` Kuninori Morimoto
2014-08-22  8:39             ` [PATCH 04/10 v2 resend] mmc: tmio: control multiple block transfer mode Kuninori Morimoto
2014-08-22  8:39               ` Kuninori Morimoto
2014-08-22  8:40             ` [PATCH 05/10 v2 resend] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK Kuninori Morimoto
2014-08-22  8:40               ` Kuninori Morimoto
2014-08-22  8:40             ` [PATCH 06/10 v2 resend] mmc: tmio: check ILL_FUNC instead of CBSY Kuninori Morimoto
2014-08-22  8:40               ` Kuninori Morimoto
2014-08-22  8:40             ` [PATCH 07/10 v2 resend] mmc: tmio: remove Renesas specific #ifdef Kuninori Morimoto
2014-08-22  8:40               ` Kuninori Morimoto
2014-08-22  8:40             ` [PATCH 08/10 v2 resend] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock() Kuninori Morimoto
2014-08-22  8:40               ` Kuninori Morimoto
2014-08-22  8:41             ` [PATCH 09/10 v2 resend] mmc: tmio: ensure that the clock has been stopped before set_clock Kuninori Morimoto
2014-08-22  8:41               ` Kuninori Morimoto
2014-08-25  2:57           ` [PATCH 0/9 v3] mmc: tmio: fixup patches Kuninori Morimoto
2014-08-25  2:57             ` Kuninori Morimoto
2014-08-25  2:58             ` [PATCH 1/9 v3] mmc: tmio: care about DMA tx/rx addr offset Kuninori Morimoto
2014-08-25  2:58               ` Kuninori Morimoto
2014-08-25  2:59             ` [PATCH 2/9 v3] mmc: tmio: clear error IRQ status Kuninori Morimoto
2014-08-25  2:59               ` Kuninori Morimoto
2014-08-25  3:00             ` [PATCH 3/9 v3] mmc: tmio: control multiple block transfer mode Kuninori Morimoto
2014-08-25  3:00               ` Kuninori Morimoto
2014-08-25  3:00             ` [PATCH 4/9 v3] mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK Kuninori Morimoto
2014-08-25  3:00               ` Kuninori Morimoto
2014-08-25  3:01             ` [PATCH 5/9 v3] mmc: tmio: check ILL_FUNC instead of CBSY Kuninori Morimoto
2014-08-25  3:01               ` Kuninori Morimoto
2014-08-25  3:01             ` [PATCH 6/9 v3] mmc: tmio: remove Renesas specific #ifdef Kuninori Morimoto
2014-08-25  3:01               ` Kuninori Morimoto
2014-08-25  3:02             ` [PATCH 7/9 v3] mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock() Kuninori Morimoto
2014-08-25  3:02               ` Kuninori Morimoto
2014-08-25  3:02             ` [PATCH 8/9 v3] mmc: tmio: ensure that the clock has been stopped before set_clock Kuninori Morimoto
2014-08-25  3:02               ` Kuninori Morimoto
2014-08-25  3:03             ` [PATCH 9/9 v3] mmc: tmio: add actual clock support as option Kuninori Morimoto
2014-08-25  3:03               ` Kuninori Morimoto
2014-08-27 13:11             ` [PATCH 0/9 v3] mmc: tmio: fixup patches Ulf Hansson
2014-08-27 13:11               ` Ulf Hansson
2014-08-28  2:24               ` [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock Kuninori Morimoto
2014-08-28  2:24                 ` Kuninori Morimoto
2014-08-28  7:11                 ` Ulf Hansson
2014-08-28  7:11                   ` Ulf Hansson
2014-08-28  7:13                   ` Ulf Hansson
2014-08-28  7:13                     ` Ulf Hansson
2014-08-28 10:36                     ` Kuninori Morimoto
2014-08-28 10:36                       ` Kuninori Morimoto

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.