All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-06 17:35 ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-sh, g.liakhovetski, Arnd Hannemann, Ian Molton, Samuel Ortiz

This patch implements SDIO IRQ support for mfds which
announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.

This patch applies on top of:
mmc: tmio_mmc: allow multi-element scatter-gather lists
mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
mmc: tmio: merge the private header into the driver
mmc: tmio: implement a bounce buffer for unaligned DMA

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
CC: Ian Molton <ian@mnementh.co.uk>
CC: Samuel Ortiz <sameo@linux.intel.com>
CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 57ece9d..dbb1105 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -53,6 +53,8 @@
 #define CTL_SD_ERROR_DETAIL_STATUS 0x2c
 #define CTL_SD_DATA_PORT 0x30
 #define CTL_TRANSACTION_CTL 0x34
+#define CTL_SDIO_STATUS 0x36
+#define CTL_SDIO_IRQ_MASK 0x38
 #define CTL_RESET_SD 0xe0
 #define CTL_SDIO_REGS 0x100
 #define CTL_CLK_AND_WAIT_CTL 0x138
@@ -81,6 +83,12 @@
 #define TMIO_STAT_CMD_BUSY      0x40000000
 #define TMIO_STAT_ILL_ACCESS    0x80000000
 
+/* Definitions for values the CTRL_SDIO_STATUS register can take. */
+#define TMIO_SDIO_STAT_IOIRQ	0x0001
+#define TMIO_SDIO_STAT_EXPUB52	0x4000
+#define TMIO_SDIO_STAT_EXWT	0x8000
+#define TMIO_SDIO_MASK_ALL	0xc007
+
 /* Define some IRQ masks */
 /* This is the mask used at reset by the chip */
 #define TMIO_MASK_ALL           0x837f031d
@@ -122,6 +130,7 @@ struct tmio_mmc_host {
 	struct mmc_data         *data;
 	struct mmc_host         *mmc;
 	int                     irq;
+	unsigned int		sdio_irq_enabled;
 
 	/* Callbacks for clock / power control */
 	void (*set_pwr)(struct platform_device *host, int state);
@@ -247,6 +256,22 @@ void pr_debug_status(u32 status)
 #define pr_debug_status(s)  do { } while (0)
 #endif
 
+static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+	struct tmio_mmc_host *host = mmc_priv(mmc);
+
+	if (enable) {
+		host->sdio_irq_enabled = 1;
+		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
+		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK,
+		(TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ));
+	} else {
+		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, TMIO_SDIO_MASK_ALL);
+		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
+		host->sdio_irq_enabled = 0;
+	}
+}
+
 static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 {
 	u32 clk = 0, clock;
@@ -279,6 +304,9 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
 	msleep(10);
 	sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
+	/* restore sdio irq state */
+	if (host->mmc->caps & MMC_CAP_SDIO_IRQ)
+		tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
 	msleep(10);
 }
 
@@ -557,6 +585,7 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 {
 	struct tmio_mmc_host *host = devid;
 	unsigned int ireg, irq_mask, status;
+	unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
 
 	pr_debug("MMC IRQ begin\n");
 
@@ -564,10 +593,30 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 	irq_mask = sd_ctrl_read32(host, CTL_IRQ_MASK);
 	ireg = status & TMIO_MASK_IRQ & ~irq_mask;
 
+	sdio_ireg = 0;
+	if (host->mmc->caps & MMC_CAP_SDIO_IRQ) {
+		sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
+		sdio_irq_mask = sd_ctrl_read16(host, CTL_SDIO_IRQ_MASK);
+		sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL & ~sdio_irq_mask;
+
+		if (sdio_ireg || (!ireg && !host->sdio_irq_enabled))
+			pr_debug("%s: sdio_i=0x%04x sdio_s=0x%04x "
+				"mask=0x%04x ireg=0x%08x spur=%u\n",
+				mmc_hostname(host->mmc),
+				sdio_ireg, sdio_status, sdio_irq_mask, ireg,
+				!ireg && !host->sdio_irq_enabled);
+
+		/* ack all sdio interrupts... */
+		sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
+
+		if (sdio_ireg & TMIO_SDIO_STAT_IOIRQ)
+			mmc_signal_sdio_irq(host->mmc);
+	}
+
 	pr_debug_status(status);
 	pr_debug_status(ireg);
 
-	if (!ireg) {
+	if (!ireg && !sdio_ireg) {
 		disable_mmc_irqs(host, status & ~irq_mask);
 
 		pr_warning("tmio_mmc: Spurious irq, disabling! "
@@ -1033,6 +1082,7 @@ static const struct mmc_host_ops tmio_mmc_ops = {
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= tmio_mmc_get_cd,
+	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
 };
 
 #ifdef CONFIG_PM
@@ -1147,6 +1197,8 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 		goto cell_disable;
 
 	disable_mmc_irqs(host, TMIO_MASK_ALL);
+	if (mmc->caps & MMC_CAP_SDIO_IRQ)
+		tmio_mmc_enable_sdio_irq(mmc, 0);
 
 	ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED |
 		IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host);
-- 
1.7.0.4


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

* [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-06 17:35 ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-sh, g.liakhovetski, Arnd Hannemann, Ian Molton, Samuel Ortiz

This patch implements SDIO IRQ support for mfds which
announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.

This patch applies on top of:
mmc: tmio_mmc: allow multi-element scatter-gather lists
mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
mmc: tmio: merge the private header into the driver
mmc: tmio: implement a bounce buffer for unaligned DMA

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
CC: Ian Molton <ian@mnementh.co.uk>
CC: Samuel Ortiz <sameo@linux.intel.com>
CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 57ece9d..dbb1105 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -53,6 +53,8 @@
 #define CTL_SD_ERROR_DETAIL_STATUS 0x2c
 #define CTL_SD_DATA_PORT 0x30
 #define CTL_TRANSACTION_CTL 0x34
+#define CTL_SDIO_STATUS 0x36
+#define CTL_SDIO_IRQ_MASK 0x38
 #define CTL_RESET_SD 0xe0
 #define CTL_SDIO_REGS 0x100
 #define CTL_CLK_AND_WAIT_CTL 0x138
@@ -81,6 +83,12 @@
 #define TMIO_STAT_CMD_BUSY      0x40000000
 #define TMIO_STAT_ILL_ACCESS    0x80000000
 
+/* Definitions for values the CTRL_SDIO_STATUS register can take. */
+#define TMIO_SDIO_STAT_IOIRQ	0x0001
+#define TMIO_SDIO_STAT_EXPUB52	0x4000
+#define TMIO_SDIO_STAT_EXWT	0x8000
+#define TMIO_SDIO_MASK_ALL	0xc007
+
 /* Define some IRQ masks */
 /* This is the mask used at reset by the chip */
 #define TMIO_MASK_ALL           0x837f031d
@@ -122,6 +130,7 @@ struct tmio_mmc_host {
 	struct mmc_data         *data;
 	struct mmc_host         *mmc;
 	int                     irq;
+	unsigned int		sdio_irq_enabled;
 
 	/* Callbacks for clock / power control */
 	void (*set_pwr)(struct platform_device *host, int state);
@@ -247,6 +256,22 @@ void pr_debug_status(u32 status)
 #define pr_debug_status(s)  do { } while (0)
 #endif
 
+static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+	struct tmio_mmc_host *host = mmc_priv(mmc);
+
+	if (enable) {
+		host->sdio_irq_enabled = 1;
+		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
+		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK,
+		(TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ));
+	} else {
+		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, TMIO_SDIO_MASK_ALL);
+		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
+		host->sdio_irq_enabled = 0;
+	}
+}
+
 static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 {
 	u32 clk = 0, clock;
@@ -279,6 +304,9 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
 	msleep(10);
 	sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
+	/* restore sdio irq state */
+	if (host->mmc->caps & MMC_CAP_SDIO_IRQ)
+		tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
 	msleep(10);
 }
 
@@ -557,6 +585,7 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 {
 	struct tmio_mmc_host *host = devid;
 	unsigned int ireg, irq_mask, status;
+	unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
 
 	pr_debug("MMC IRQ begin\n");
 
@@ -564,10 +593,30 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 	irq_mask = sd_ctrl_read32(host, CTL_IRQ_MASK);
 	ireg = status & TMIO_MASK_IRQ & ~irq_mask;
 
+	sdio_ireg = 0;
+	if (host->mmc->caps & MMC_CAP_SDIO_IRQ) {
+		sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
+		sdio_irq_mask = sd_ctrl_read16(host, CTL_SDIO_IRQ_MASK);
+		sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL & ~sdio_irq_mask;
+
+		if (sdio_ireg || (!ireg && !host->sdio_irq_enabled))
+			pr_debug("%s: sdio_i=0x%04x sdio_s=0x%04x "
+				"mask=0x%04x ireg=0x%08x spur=%u\n",
+				mmc_hostname(host->mmc),
+				sdio_ireg, sdio_status, sdio_irq_mask, ireg,
+				!ireg && !host->sdio_irq_enabled);
+
+		/* ack all sdio interrupts... */
+		sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
+
+		if (sdio_ireg & TMIO_SDIO_STAT_IOIRQ)
+			mmc_signal_sdio_irq(host->mmc);
+	}
+
 	pr_debug_status(status);
 	pr_debug_status(ireg);
 
-	if (!ireg) {
+	if (!ireg && !sdio_ireg) {
 		disable_mmc_irqs(host, status & ~irq_mask);
 
 		pr_warning("tmio_mmc: Spurious irq, disabling! "
@@ -1033,6 +1082,7 @@ static const struct mmc_host_ops tmio_mmc_ops = {
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= tmio_mmc_get_cd,
+	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
 };
 
 #ifdef CONFIG_PM
@@ -1147,6 +1197,8 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 		goto cell_disable;
 
 	disable_mmc_irqs(host, TMIO_MASK_ALL);
+	if (mmc->caps & MMC_CAP_SDIO_IRQ)
+		tmio_mmc_enable_sdio_irq(mmc, 0);
 
 	ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED |
 		IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host);
-- 
1.7.0.4


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

* [PATCH 2/4] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
  2010-12-06 17:35 ` Arnd Hannemann
@ 2010-12-06 17:35   ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, g.liakhovetski, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on AP4EVB. Tested with a b43-based SDIO wireless card.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/arm/mach-shmobile/board-ap4evb.c |    3 ++-
 arch/arm/mach-shmobile/intc-sh7372.c  |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 16eba07..5763b0d 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -310,6 +310,7 @@ static u64 sdhi0_dma_mask = DMA_BIT_MASK(32);
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps	= MMC_CAP_SDIO_IRQ,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -344,7 +345,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_ocr_mask	= MMC_VDD_165_195,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
-	.tmio_caps	= MMC_CAP_NEEDS_POLL,
+	.tmio_caps	= MMC_CAP_NEEDS_POLL | MMC_CAP_SDIO_IRQ,
 	.get_cd		= slot_cn7_get_cd,
 };
 
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 30b2f40..f78a1ea 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -230,10 +230,10 @@ static struct intc_mask_reg intca_mask_registers[] __initdata = {
 	  { SCIFB, SCIFA5, SCIFA4, MSIOF1,
 	    0, 0, MSIOF2, 0 } },
 	{ 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
-	  { DISABLED, DISABLED, ENABLED, ENABLED,
+	  { DISABLED, ENABLED, ENABLED, ENABLED,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
 	{ 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
-	  { 0, DISABLED, ENABLED, ENABLED,
+	  { 0, ENABLED, ENABLED, ENABLED,
 	    TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
 	{ 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
 	  { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
-- 
1.7.0.4


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

* [PATCH 2/4] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
@ 2010-12-06 17:35   ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, g.liakhovetski, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on AP4EVB. Tested with a b43-based SDIO wireless card.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/arm/mach-shmobile/board-ap4evb.c |    3 ++-
 arch/arm/mach-shmobile/intc-sh7372.c  |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 16eba07..5763b0d 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -310,6 +310,7 @@ static u64 sdhi0_dma_mask = DMA_BIT_MASK(32);
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps	= MMC_CAP_SDIO_IRQ,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -344,7 +345,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_ocr_mask	= MMC_VDD_165_195,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
-	.tmio_caps	= MMC_CAP_NEEDS_POLL,
+	.tmio_caps	= MMC_CAP_NEEDS_POLL | MMC_CAP_SDIO_IRQ,
 	.get_cd		= slot_cn7_get_cd,
 };
 
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 30b2f40..f78a1ea 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -230,10 +230,10 @@ static struct intc_mask_reg intca_mask_registers[] __initdata = {
 	  { SCIFB, SCIFA5, SCIFA4, MSIOF1,
 	    0, 0, MSIOF2, 0 } },
 	{ 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
-	  { DISABLED, DISABLED, ENABLED, ENABLED,
+	  { DISABLED, ENABLED, ENABLED, ENABLED,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
 	{ 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
-	  { 0, DISABLED, ENABLED, ENABLED,
+	  { 0, ENABLED, ENABLED, ENABLED,
 	    TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
 	{ 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
 	  { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
-- 
1.7.0.4


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

* [PATCH 3/4] sh: sh7724 Enable SDIO IRQs
  2010-12-06 17:35 ` Arnd Hannemann
@ 2010-12-06 17:35   ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, g.liakhovetski, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on ecovec, kfr2r09 and se7724.

Tested with a b43-based SDIO wireless card on ecovec.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-ecovec24/setup.c   |    2 ++
 arch/sh/boards/mach-kfr2r09/setup.c    |    1 +
 arch/sh/boards/mach-se/7724/setup.c    |    2 ++
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c |    4 ++--
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 4e0e65a..36d7ca7 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -476,6 +476,7 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.set_pwr	= sdhi0_set_pwr,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -517,6 +518,7 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state)
 static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 	.set_pwr	= sdhi1_set_pwr,
 };
 
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 1423aa3..4e2eefe 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -369,6 +369,7 @@ static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device kfr2r09_sh_sdhi0_device = {
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index ab187c9..4eeb7c7 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -470,6 +470,7 @@ static struct resource sdhi0_cn7_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi0_cn7_device = {
@@ -504,6 +505,7 @@ static struct resource sdhi1_cn8_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi1_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi1_cn8_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 828c965..c598a7f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -1144,7 +1144,7 @@ static struct intc_group groups[] __initdata = {
 static struct intc_mask_reg mask_registers[] __initdata = {
 	{ 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
 	  { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
-	    0, DISABLED, ENABLED, ENABLED } },
+	    0, ENABLED, ENABLED, ENABLED } },
 	{ 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
 	  { VIO_VOU, VIO_VEU1, VIO_BEU0, VIO_CEU0,
 	    DMAC0A_DEI3, DMAC0A_DEI2, DMAC0A_DEI1, DMAC0A_DEI0 } },
@@ -1166,7 +1166,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C0_DTEI, I2C0_WAITI, I2C0_TACKI, I2C0_ALI,
 	    I2C1_DTEI, I2C1_WAITI, I2C1_TACKI, I2C1_ALI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED,
+	  { DISABLED, ENABLED, ENABLED, ENABLED,
 	    0, 0, SCIFA5, FSI } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB1, USB0, 0 } },
-- 
1.7.0.4


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

* [PATCH 3/4] sh: sh7724 Enable SDIO IRQs
@ 2010-12-06 17:35   ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, g.liakhovetski, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on ecovec, kfr2r09 and se7724.

Tested with a b43-based SDIO wireless card on ecovec.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-ecovec24/setup.c   |    2 ++
 arch/sh/boards/mach-kfr2r09/setup.c    |    1 +
 arch/sh/boards/mach-se/7724/setup.c    |    2 ++
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c |    4 ++--
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 4e0e65a..36d7ca7 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -476,6 +476,7 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.set_pwr	= sdhi0_set_pwr,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -517,6 +518,7 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state)
 static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 	.set_pwr	= sdhi1_set_pwr,
 };
 
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 1423aa3..4e2eefe 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -369,6 +369,7 @@ static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device kfr2r09_sh_sdhi0_device = {
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index ab187c9..4eeb7c7 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -470,6 +470,7 @@ static struct resource sdhi0_cn7_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi0_cn7_device = {
@@ -504,6 +505,7 @@ static struct resource sdhi1_cn8_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi1_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi1_cn8_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 828c965..c598a7f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -1144,7 +1144,7 @@ static struct intc_group groups[] __initdata = {
 static struct intc_mask_reg mask_registers[] __initdata = {
 	{ 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
 	  { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
-	    0, DISABLED, ENABLED, ENABLED } },
+	    0, ENABLED, ENABLED, ENABLED } },
 	{ 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
 	  { VIO_VOU, VIO_VEU1, VIO_BEU0, VIO_CEU0,
 	    DMAC0A_DEI3, DMAC0A_DEI2, DMAC0A_DEI1, DMAC0A_DEI0 } },
@@ -1166,7 +1166,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C0_DTEI, I2C0_WAITI, I2C0_TACKI, I2C0_ALI,
 	    I2C1_DTEI, I2C1_WAITI, I2C1_TACKI, I2C1_ALI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED,
+	  { DISABLED, ENABLED, ENABLED, ENABLED,
 	    0, 0, SCIFA5, FSI } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB1, USB0, 0 } },
-- 
1.7.0.4


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

* [PATCH 4/4] [RFC] sh: sh7722 Enable SDIO IRQs
  2010-12-06 17:35 ` Arnd Hannemann
@ 2010-12-06 17:35   ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, g.liakhovetski, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on migor. Untested, therefore RFC.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-migor/setup.c      |    1 +
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 5dc72b4..b9cba53 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -413,6 +413,7 @@ static struct resource sdhi_cn9_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi_cn9_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index d551ed8..a164f89 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -699,7 +699,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
+	  { DISABLED, ENABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } },
 	{ 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
-- 
1.7.0.4


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

* [PATCH 4/4] [RFC] sh: sh7722 Enable SDIO IRQs
@ 2010-12-06 17:35   ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-06 17:35 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-sh, g.liakhovetski, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on migor. Untested, therefore RFC.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-migor/setup.c      |    1 +
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 5dc72b4..b9cba53 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -413,6 +413,7 @@ static struct resource sdhi_cn9_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi_cn9_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index d551ed8..a164f89 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -699,7 +699,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
+	  { DISABLED, ENABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } },
 	{ 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
-- 
1.7.0.4


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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-06 17:35 ` Arnd Hannemann
@ 2010-12-07  5:39   ` Magnus Damm
  -1 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-07  5:39 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Arnd,

On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> This patch implements SDIO IRQ support for mfds which
> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>
> This patch applies on top of:
> mmc: tmio_mmc: allow multi-element scatter-gather lists
> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
> mmc: tmio: merge the private header into the driver
> mmc: tmio: implement a bounce buffer for unaligned DMA
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
> CC: Ian Molton <ian@mnementh.co.uk>
> CC: Samuel Ortiz <sameo@linux.intel.com>
> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 53 insertions(+), 1 deletions(-)

Thanks for your work on this!

Just curious, did you test this change in 4-bit mode and/or 1-bit
mode? I believe that 1-bit mode support is rather simple, but 4-bit
mode requires toggling between the IRQ and DATA function which happen
to be using the same pin. It looks like the current code only deals
with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
driver?

Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
in the CCCR should specify if it's allowed to enable interrupts in
between data transfers or not. Perhaps that is something we need to
deal with in the driver? Or maybe the framework needs to be extended?

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-07  5:39   ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-07  5:39 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Arnd,

On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> This patch implements SDIO IRQ support for mfds which
> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>
> This patch applies on top of:
> mmc: tmio_mmc: allow multi-element scatter-gather lists
> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
> mmc: tmio: merge the private header into the driver
> mmc: tmio: implement a bounce buffer for unaligned DMA
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
> CC: Ian Molton <ian@mnementh.co.uk>
> CC: Samuel Ortiz <sameo@linux.intel.com>
> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 53 insertions(+), 1 deletions(-)

Thanks for your work on this!

Just curious, did you test this change in 4-bit mode and/or 1-bit
mode? I believe that 1-bit mode support is rather simple, but 4-bit
mode requires toggling between the IRQ and DATA function which happen
to be using the same pin. It looks like the current code only deals
with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
driver?

Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
in the CCCR should specify if it's allowed to enable interrupts in
between data transfers or not. Perhaps that is something we need to
deal with in the driver? Or maybe the framework needs to be extended?

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-07  5:39   ` Magnus Damm
@ 2010-12-07 12:22     ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-07 12:22 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Magnus,

Am 07.12.2010 00:39, schrieb Magnus Damm:
> Hi Arnd,
> 
> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>> This patch implements SDIO IRQ support for mfds which
>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>
>> This patch applies on top of:
>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>> mmc: tmio: merge the private header into the driver
>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>
>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>> CC: Ian Molton <ian@mnementh.co.uk>
>> CC: Samuel Ortiz <sameo@linux.intel.com>
>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> ---
>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>  1 files changed, 53 insertions(+), 1 deletions(-)
> 
> Thanks for your work on this!
> 
> Just curious, did you test this change in 4-bit mode and/or 1-bit
> mode? I believe that 1-bit mode support is rather simple, but 4-bit
> mode requires toggling between the IRQ and DATA function which happen
> to be using the same pin. It looks like the current code only deals
> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
> driver?

Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
it says "width=2". I also read about the toggling, and expected to do
something fancy, but when tests where successful I came to the conclusion
that the controller does the toggling for us. Do you believe otherwise?

> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
> in the CCCR should specify if it's allowed to enable interrupts in
> between data transfers or not. Perhaps that is something we need to
> deal with in the driver? Or maybe the framework needs to be extended?

I quick grep shows that nobody seems to care about this bit until now...

Thanks,
Arnd


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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-07 12:22     ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-07 12:22 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Magnus,

Am 07.12.2010 00:39, schrieb Magnus Damm:
> Hi Arnd,
> 
> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>> This patch implements SDIO IRQ support for mfds which
>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>
>> This patch applies on top of:
>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>> mmc: tmio: merge the private header into the driver
>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>
>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>> CC: Ian Molton <ian@mnementh.co.uk>
>> CC: Samuel Ortiz <sameo@linux.intel.com>
>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>> ---
>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>  1 files changed, 53 insertions(+), 1 deletions(-)
> 
> Thanks for your work on this!
> 
> Just curious, did you test this change in 4-bit mode and/or 1-bit
> mode? I believe that 1-bit mode support is rather simple, but 4-bit
> mode requires toggling between the IRQ and DATA function which happen
> to be using the same pin. It looks like the current code only deals
> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
> driver?

Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
it says "width=2". I also read about the toggling, and expected to do
something fancy, but when tests where successful I came to the conclusion
that the controller does the toggling for us. Do you believe otherwise?

> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
> in the CCCR should specify if it's allowed to enable interrupts in
> between data transfers or not. Perhaps that is something we need to
> deal with in the driver? Or maybe the framework needs to be extended?

I quick grep shows that nobody seems to care about this bit until now...

Thanks,
Arnd


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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-07 12:22     ` Arnd Hannemann
@ 2010-12-07 14:37       ` Magnus Damm
  -1 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-07 14:37 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
> Am 07.12.2010 00:39, schrieb Magnus Damm:
>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>> This patch implements SDIO IRQ support for mfds which
>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>
>>> This patch applies on top of:
>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>> mmc: tmio: merge the private header into the driver
>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>
>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>> CC: Ian Molton <ian@mnementh.co.uk>
>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>> ---
>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>
>> Thanks for your work on this!
>>
>> Just curious, did you test this change in 4-bit mode and/or 1-bit
>> mode? I believe that 1-bit mode support is rather simple, but 4-bit
>> mode requires toggling between the IRQ and DATA function which happen
>> to be using the same pin. It looks like the current code only deals
>> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
>> driver?
>
> Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
> it says "width=2". I also read about the toggling, and expected to do
> something fancy, but when tests where successful I came to the conclusion
> that the controller does the toggling for us. Do you believe otherwise?

Yes, I believe something more advanced is needed for 4-bit mode. But I
don't really have any proof. I just know that I spent quite some time
trying to get it to work and ended up staying in polling mode because
enabling real IRQs seemed to require too much time. This was before
some interrupt ack fixes so things may have improved since then. I
also remember both testing on b43 hardware and AR6002.

There are a couple of things against us at this point:

a) b43 hardware may not be enough to test this

are you really sure 4-bit mode is enabled? =)
is the b43 driver doing multi-block data transfers? i believe IRQs
work differently for multi-block data transfers and single-block.

b) we don't have any public data sheet for the SDHI hardware block

how good is that?

c) the simplified SDIO spec is not exactly full of details:

8.1.3
Interrupt Period Definition
This section is not included in the Simplified Specification.
8.1.4
Interrupt Period at the Data Block Gap in 4-bit SD Mode (Optional)
This section is not included in the Simplified Specification.
8.1.5
Inhibited Interrupts (Removed Section)
This section is not included in the Simplified Specification.
8.1.6
End of Interrupt Cycles
This section is not included in the Simplified Specification.

>> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
>> in the CCCR should specify if it's allowed to enable interrupts in
>> between data transfers or not. Perhaps that is something we need to
>> deal with in the driver? Or maybe the framework needs to be extended?
>
> I quick grep shows that nobody seems to care about this bit until now...

Yeah, that seems to be the case. I guess it's a non-issue then. =)

I'll try to find my AR6002 card, maybe that will shed some light...

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-07 14:37       ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-07 14:37 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
> Am 07.12.2010 00:39, schrieb Magnus Damm:
>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>> This patch implements SDIO IRQ support for mfds which
>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>
>>> This patch applies on top of:
>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>> mmc: tmio: merge the private header into the driver
>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>
>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>> CC: Ian Molton <ian@mnementh.co.uk>
>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>> ---
>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>
>> Thanks for your work on this!
>>
>> Just curious, did you test this change in 4-bit mode and/or 1-bit
>> mode? I believe that 1-bit mode support is rather simple, but 4-bit
>> mode requires toggling between the IRQ and DATA function which happen
>> to be using the same pin. It looks like the current code only deals
>> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
>> driver?
>
> Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
> it says "width=2". I also read about the toggling, and expected to do
> something fancy, but when tests where successful I came to the conclusion
> that the controller does the toggling for us. Do you believe otherwise?

Yes, I believe something more advanced is needed for 4-bit mode. But I
don't really have any proof. I just know that I spent quite some time
trying to get it to work and ended up staying in polling mode because
enabling real IRQs seemed to require too much time. This was before
some interrupt ack fixes so things may have improved since then. I
also remember both testing on b43 hardware and AR6002.

There are a couple of things against us at this point:

a) b43 hardware may not be enough to test this

are you really sure 4-bit mode is enabled? =)
is the b43 driver doing multi-block data transfers? i believe IRQs
work differently for multi-block data transfers and single-block.

b) we don't have any public data sheet for the SDHI hardware block

how good is that?

c) the simplified SDIO spec is not exactly full of details:

8.1.3
Interrupt Period Definition
This section is not included in the Simplified Specification.
8.1.4
Interrupt Period at the Data Block Gap in 4-bit SD Mode (Optional)
This section is not included in the Simplified Specification.
8.1.5
Inhibited Interrupts (Removed Section)
This section is not included in the Simplified Specification.
8.1.6
End of Interrupt Cycles
This section is not included in the Simplified Specification.

>> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
>> in the CCCR should specify if it's allowed to enable interrupts in
>> between data transfers or not. Perhaps that is something we need to
>> deal with in the driver? Or maybe the framework needs to be extended?
>
> I quick grep shows that nobody seems to care about this bit until now...

Yeah, that seems to be the case. I guess it's a non-issue then. =)

I'll try to find my AR6002 card, maybe that will shed some light...

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-07 14:37       ` Magnus Damm
@ 2010-12-07 15:08         ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-07 15:08 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Magnus,

Am 07.12.2010 09:37, schrieb Magnus Damm:
> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>> This patch implements SDIO IRQ support for mfds which
>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>
>>>> This patch applies on top of:
>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>> mmc: tmio: merge the private header into the driver
>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>
>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>> ---
>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>
>>> Thanks for your work on this!
>>>
>>> Just curious, did you test this change in 4-bit mode and/or 1-bit
>>> mode? I believe that 1-bit mode support is rather simple, but 4-bit
>>> mode requires toggling between the IRQ and DATA function which happen
>>> to be using the same pin. It looks like the current code only deals
>>> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
>>> driver?
>>
>> Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
>> it says "width=2". I also read about the toggling, and expected to do
>> something fancy, but when tests where successful I came to the conclusion
>> that the controller does the toggling for us. Do you believe otherwise?
> 
> Yes, I believe something more advanced is needed for 4-bit mode. But I
> don't really have any proof. I just know that I spent quite some time
> trying to get it to work and ended up staying in polling mode because
> enabling real IRQs seemed to require too much time. This was before
> some interrupt ack fixes so things may have improved since then. I
> also remember both testing on b43 hardware and AR6002.

There was also this nasty DMA issue Guennadi fixed recently...

> 
> There are a couple of things against us at this point:
> 
> a) b43 hardware may not be enough to test this

Ok, do you still have that AR6002 and could test with that by any chance?

> are you really sure 4-bit mode is enabled? =)
> is the b43 driver doing multi-block data transfers? i believe IRQs
> work differently for multi-block data transfers and single-block.

I'm pretty sure its using 4-bit mode, from the probe of the card:

mmc1: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 2 timing 0

Its doing probably not doing any multi-block data transfers, but I'll
recheck. Actually most data transfers are very small.
 
> b) we don't have any public data sheet for the SDHI hardware block
> 
> how good is that?
> 
> c) the simplified SDIO spec is not exactly full of details:
> 
> 8.1.3
> Interrupt Period Definition
> This section is not included in the Simplified Specification.
> 8.1.4
> Interrupt Period at the Data Block Gap in 4-bit SD Mode (Optional)
> This section is not included in the Simplified Specification.
> 8.1.5
> Inhibited Interrupts (Removed Section)
> This section is not included in the Simplified Specification.
> 8.1.6
> End of Interrupt Cycles
> This section is not included in the Simplified Specification.

Yes I read this too, but this is of course only interface
between host and card, so we may be just lucky that the controller
hides these details from us.

>>> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
>>> in the CCCR should specify if it's allowed to enable interrupts in
>>> between data transfers or not. Perhaps that is something we need to
>>> deal with in the driver? Or maybe the framework needs to be extended?
>>
>> I quick grep shows that nobody seems to care about this bit until now...
> 
> Yeah, that seems to be the case. I guess it's a non-issue then. =)
> 
> I'll try to find my AR6002 card, maybe that will shed some light...

Yeah, that would be really cool.

Thanks,
Arnd

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-07 15:08         ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-07 15:08 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Magnus,

Am 07.12.2010 09:37, schrieb Magnus Damm:
> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>> This patch implements SDIO IRQ support for mfds which
>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>
>>>> This patch applies on top of:
>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>> mmc: tmio: merge the private header into the driver
>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>
>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>> ---
>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>
>>> Thanks for your work on this!
>>>
>>> Just curious, did you test this change in 4-bit mode and/or 1-bit
>>> mode? I believe that 1-bit mode support is rather simple, but 4-bit
>>> mode requires toggling between the IRQ and DATA function which happen
>>> to be using the same pin. It looks like the current code only deals
>>> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
>>> driver?
>>
>> Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
>> it says "width=2". I also read about the toggling, and expected to do
>> something fancy, but when tests where successful I came to the conclusion
>> that the controller does the toggling for us. Do you believe otherwise?
> 
> Yes, I believe something more advanced is needed for 4-bit mode. But I
> don't really have any proof. I just know that I spent quite some time
> trying to get it to work and ended up staying in polling mode because
> enabling real IRQs seemed to require too much time. This was before
> some interrupt ack fixes so things may have improved since then. I
> also remember both testing on b43 hardware and AR6002.

There was also this nasty DMA issue Guennadi fixed recently...

> 
> There are a couple of things against us at this point:
> 
> a) b43 hardware may not be enough to test this

Ok, do you still have that AR6002 and could test with that by any chance?

> are you really sure 4-bit mode is enabled? =)
> is the b43 driver doing multi-block data transfers? i believe IRQs
> work differently for multi-block data transfers and single-block.

I'm pretty sure its using 4-bit mode, from the probe of the card:

mmc1: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 2 timing 0

Its doing probably not doing any multi-block data transfers, but I'll
recheck. Actually most data transfers are very small.
 
> b) we don't have any public data sheet for the SDHI hardware block
> 
> how good is that?
> 
> c) the simplified SDIO spec is not exactly full of details:
> 
> 8.1.3
> Interrupt Period Definition
> This section is not included in the Simplified Specification.
> 8.1.4
> Interrupt Period at the Data Block Gap in 4-bit SD Mode (Optional)
> This section is not included in the Simplified Specification.
> 8.1.5
> Inhibited Interrupts (Removed Section)
> This section is not included in the Simplified Specification.
> 8.1.6
> End of Interrupt Cycles
> This section is not included in the Simplified Specification.

Yes I read this too, but this is of course only interface
between host and card, so we may be just lucky that the controller
hides these details from us.

>>> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
>>> in the CCCR should specify if it's allowed to enable interrupts in
>>> between data transfers or not. Perhaps that is something we need to
>>> deal with in the driver? Or maybe the framework needs to be extended?
>>
>> I quick grep shows that nobody seems to care about this bit until now...
> 
> Yeah, that seems to be the case. I guess it's a non-issue then. =)
> 
> I'll try to find my AR6002 card, maybe that will shed some light...

Yeah, that would be really cool.

Thanks,
Arnd

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-07 15:08         ` Arnd Hannemann
@ 2010-12-14 15:44           ` Magnus Damm
  -1 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-14 15:44 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Arnd,

Thanks a lot for your help so far. I've found a bit of time to test stuff now.

On Wed, Dec 8, 2010 at 12:08 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> Am 07.12.2010 09:37, schrieb Magnus Damm:
>> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>> This patch implements SDIO IRQ support for mfds which
>>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>>
>>>>> This patch applies on top of:
>>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>>> mmc: tmio: merge the private header into the driver
>>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>>
>>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>> ---
>>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>>
>>>> Thanks for your work on this!
>>>>
>>>> Just curious, did you test this change in 4-bit mode and/or 1-bit
>>>> mode? I believe that 1-bit mode support is rather simple, but 4-bit
>>>> mode requires toggling between the IRQ and DATA function which happen
>>>> to be using the same pin. It looks like the current code only deals
>>>> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
>>>> driver?
>>>
>>> Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
>>> it says "width=2". I also read about the toggling, and expected to do
>>> something fancy, but when tests where successful I came to the conclusion
>>> that the controller does the toggling for us. Do you believe otherwise?
>>
>> Yes, I believe something more advanced is needed for 4-bit mode. But I
>> don't really have any proof. I just know that I spent quite some time
>> trying to get it to work and ended up staying in polling mode because
>> enabling real IRQs seemed to require too much time. This was before
>> some interrupt ack fixes so things may have improved since then. I
>> also remember both testing on b43 hardware and AR6002.
>
> There was also this nasty DMA issue Guennadi fixed recently...

Good with issues fixed, we like that. =)

We also like fixes ending up in mainline - does someone need to
resubmit their patches I wonder? =)

>> There are a couple of things against us at this point:
>>
>> a) b43 hardware may not be enough to test this
>
> Ok, do you still have that AR6002 and could test with that by any chance?

So I tried my AR6002 card - spent half an evening - but I couldn't get
it working with the driver in staging.

I tested at least 3 different drivers last time around, and I ended up
using the ar6k android driver:
http://armin762.wordpress.com/2010/05/24/nvidia-tegra2-getting-wifiatheros-6002-working/

I suppose I should retry with the out-of-tree driver above. Hm.

>> are you really sure 4-bit mode is enabled? =)
>> is the b43 driver doing multi-block data transfers? i believe IRQs
>> work differently for multi-block data transfers and single-block.
>
> I'm pretty sure its using 4-bit mode, from the probe of the card:
>
> mmc1: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 2 timing 0

Ok, that looks good.

> Its doing probably not doing any multi-block data transfers, but I'll
> recheck. Actually most data transfers are very small.

So I at least managed to test b43 with DMA enabled and your SDIO IRQ
patch applied.

Your SDIO IRQ patch significantly decreases interrupt load. Without
your SDIO IRQ patch about 100 interrupts per second are generated from
the polling. Same test but with the SDIO IRQ patch applied (b43 wlan0
up but not associated) I receive no IRQs at all until I perform some
kind of action like "iwlist wlan0 scan". I suppose this shows the
benefit of IRQs vs polled mode. =)

>> b) we don't have any public data sheet for the SDHI hardware block
>>
>> how good is that?
>>
>> c) the simplified SDIO spec is not exactly full of details:
>>
>> 8.1.3
>> Interrupt Period Definition
>> This section is not included in the Simplified Specification.
>> 8.1.4
>> Interrupt Period at the Data Block Gap in 4-bit SD Mode (Optional)
>> This section is not included in the Simplified Specification.
>> 8.1.5
>> Inhibited Interrupts (Removed Section)
>> This section is not included in the Simplified Specification.
>> 8.1.6
>> End of Interrupt Cycles
>> This section is not included in the Simplified Specification.
>
> Yes I read this too, but this is of course only interface
> between host and card, so we may be just lucky that the controller
> hides these details from us.

True, or that everyone just implements the same thing regardless of the spec.

>>>> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
>>>> in the CCCR should specify if it's allowed to enable interrupts in
>>>> between data transfers or not. Perhaps that is something we need to
>>>> deal with in the driver? Or maybe the framework needs to be extended?
>>>
>>> I quick grep shows that nobody seems to care about this bit until now...
>>
>> Yeah, that seems to be the case. I guess it's a non-issue then. =)
>>
>> I'll try to find my AR6002 card, maybe that will shed some light...
>
> Yeah, that would be really cool.

I'll try again next time I have a bit of time to spare. =)

Until then, is there any chance you can look into supporting INTC
forwarding in ENABLED for the CPU code but not setting
MMC_CAP_SDIO_IRQ? I wonder if there is any pending interrupt source
that drowns the CPU with the current code?

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-14 15:44           ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-14 15:44 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Arnd,

Thanks a lot for your help so far. I've found a bit of time to test stuff now.

On Wed, Dec 8, 2010 at 12:08 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> Am 07.12.2010 09:37, schrieb Magnus Damm:
>> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>> This patch implements SDIO IRQ support for mfds which
>>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>>
>>>>> This patch applies on top of:
>>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>>> mmc: tmio: merge the private header into the driver
>>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>>
>>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>> ---
>>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>>
>>>> Thanks for your work on this!
>>>>
>>>> Just curious, did you test this change in 4-bit mode and/or 1-bit
>>>> mode? I believe that 1-bit mode support is rather simple, but 4-bit
>>>> mode requires toggling between the IRQ and DATA function which happen
>>>> to be using the same pin. It looks like the current code only deals
>>>> with 1-bit mode - perhaps 4-bit mode isn't supported by the b43
>>>> driver?
>>>
>>> Yes, I tested this in 1-bit and 4-bit mode. At least the card claims it is using it,
>>> it says "width=2". I also read about the toggling, and expected to do
>>> something fancy, but when tests where successful I came to the conclusion
>>> that the controller does the toggling for us. Do you believe otherwise?
>>
>> Yes, I believe something more advanced is needed for 4-bit mode. But I
>> don't really have any proof. I just know that I spent quite some time
>> trying to get it to work and ended up staying in polling mode because
>> enabling real IRQs seemed to require too much time. This was before
>> some interrupt ack fixes so things may have improved since then. I
>> also remember both testing on b43 hardware and AR6002.
>
> There was also this nasty DMA issue Guennadi fixed recently...

Good with issues fixed, we like that. =)

We also like fixes ending up in mainline - does someone need to
resubmit their patches I wonder? =)

>> There are a couple of things against us at this point:
>>
>> a) b43 hardware may not be enough to test this
>
> Ok, do you still have that AR6002 and could test with that by any chance?

So I tried my AR6002 card - spent half an evening - but I couldn't get
it working with the driver in staging.

I tested at least 3 different drivers last time around, and I ended up
using the ar6k android driver:
http://armin762.wordpress.com/2010/05/24/nvidia-tegra2-getting-wifiatheros-6002-working/

I suppose I should retry with the out-of-tree driver above. Hm.

>> are you really sure 4-bit mode is enabled? =)
>> is the b43 driver doing multi-block data transfers? i believe IRQs
>> work differently for multi-block data transfers and single-block.
>
> I'm pretty sure its using 4-bit mode, from the probe of the card:
>
> mmc1: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
> mmc1: clock 25000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 2 timing 0

Ok, that looks good.

> Its doing probably not doing any multi-block data transfers, but I'll
> recheck. Actually most data transfers are very small.

So I at least managed to test b43 with DMA enabled and your SDIO IRQ
patch applied.

Your SDIO IRQ patch significantly decreases interrupt load. Without
your SDIO IRQ patch about 100 interrupts per second are generated from
the polling. Same test but with the SDIO IRQ patch applied (b43 wlan0
up but not associated) I receive no IRQs at all until I perform some
kind of action like "iwlist wlan0 scan". I suppose this shows the
benefit of IRQs vs polled mode. =)

>> b) we don't have any public data sheet for the SDHI hardware block
>>
>> how good is that?
>>
>> c) the simplified SDIO spec is not exactly full of details:
>>
>> 8.1.3
>> Interrupt Period Definition
>> This section is not included in the Simplified Specification.
>> 8.1.4
>> Interrupt Period at the Data Block Gap in 4-bit SD Mode (Optional)
>> This section is not included in the Simplified Specification.
>> 8.1.5
>> Inhibited Interrupts (Removed Section)
>> This section is not included in the Simplified Specification.
>> 8.1.6
>> End of Interrupt Cycles
>> This section is not included in the Simplified Specification.
>
> Yes I read this too, but this is of course only interface
> between host and card, so we may be just lucky that the controller
> hides these details from us.

True, or that everyone just implements the same thing regardless of the spec.

>>>> Not sure how the Linux MMC stack supports 4-bit IRQs, but the S4MI bit
>>>> in the CCCR should specify if it's allowed to enable interrupts in
>>>> between data transfers or not. Perhaps that is something we need to
>>>> deal with in the driver? Or maybe the framework needs to be extended?
>>>
>>> I quick grep shows that nobody seems to care about this bit until now...
>>
>> Yeah, that seems to be the case. I guess it's a non-issue then. =)
>>
>> I'll try to find my AR6002 card, maybe that will shed some light...
>
> Yeah, that would be really cool.

I'll try again next time I have a bit of time to spare. =)

Until then, is there any chance you can look into supporting INTC
forwarding in ENABLED for the CPU code but not setting
MMC_CAP_SDIO_IRQ? I wonder if there is any pending interrupt source
that drowns the CPU with the current code?

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-14 15:44           ` Magnus Damm
@ 2010-12-20  3:58             ` Magnus Damm
  -1 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-20  3:58 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi again Arnd,

On Wed, Dec 15, 2010 at 12:44 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> On Wed, Dec 8, 2010 at 12:08 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>> Am 07.12.2010 09:37, schrieb Magnus Damm:
>>> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>>> This patch implements SDIO IRQ support for mfds which
>>>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>>>
>>>>>> This patch applies on top of:
>>>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>>>> mmc: tmio: merge the private header into the driver
>>>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>>>
>>>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>>> ---
>>>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>>>

>>> I'll try to find my AR6002 card, maybe that will shed some light...
>>
>> Yeah, that would be really cool.
>
> I'll try again next time I have a bit of time to spare. =)

Alright, now my AR6002-based card is working with your patches. At
least it seems to be working - my antenna cable is broken so I can
unfortunately not do any more proper than a simple "iwlist wlan0
scan". Good thing is that the SDIO IRQ mode and polling mode seem to
behave about the same.

Please note that I did not test using the upstream driver. I couldn't
get that one working last week, so today I reverted to using my last
known working configuration - the out-of-tree "ar69_sdk" driver
pointed out by the following instructions:
http://armin762.wordpress.com/2010/05/24/nvidia-tegra2-getting-wifiatheros-6002-working/

Anyway, I'm all for including your SDIO IRQ patches, but I think that
they should be reworked a bit.

I propose using two flags:

1) A hardware-has-sdio-irq-support flag for include/linux/mfd/tmio.h,
perhaps TMIO_MMC_SDIO_IRQ

The SDIO IRQ hardware registers are only touched when tmio-mmc is
provided the TMIO_MMC_SDIO_IRQ flag. The default behavior would be to
mask the SDIO IRQ interrupt source regardless of the MMC_CAP_SDIO_IRQ
flag. This should allow us to always enable the SDIO IRQ interrupt
source in INTC. The SDIO driver should set the TMIO_MMC_SDIO_IRQ flag
to show that SDHI is known to support SDIO IRQ.

Hopefully this TMIO_MMC_SDIO_IRQ flag will make it easier for Ian to
review the code and see that it doesn't break any other platforms that
may or may not lack SDIO IRQ support.

2) The regular MMC_CAP_SDIO_IRQ flag.

This is enabled per board. If the SDIO IRQ feature doesn't work in
some case then the system integrator can simply just simply go back to
polled mode by not setting MMC_CAP_SIDO_IRQ.

I'm not sure if we can keep the SDIO IRQ interrupt source constantly
enabled in INTC though. Your current patches require the board
specific MMC_CAP_SDIO_IRQ flag to be paired with the cpu-specific INTC
enable change. If someone wishes tho disable SDIO_IRQ support for
their board then they must know that they also need to revert the INTC
enable bits, otherwise they'll get endless interrupts when the
tmio-mmc driver starts. I believe the two-flag approach above will
solve this problem.

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-20  3:58             ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-20  3:58 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi again Arnd,

On Wed, Dec 15, 2010 at 12:44 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> On Wed, Dec 8, 2010 at 12:08 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>> Am 07.12.2010 09:37, schrieb Magnus Damm:
>>> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>>> This patch implements SDIO IRQ support for mfds which
>>>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>>>
>>>>>> This patch applies on top of:
>>>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>>>> mmc: tmio: merge the private header into the driver
>>>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>>>
>>>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>>> ---
>>>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>>>

>>> I'll try to find my AR6002 card, maybe that will shed some light...
>>
>> Yeah, that would be really cool.
>
> I'll try again next time I have a bit of time to spare. =)

Alright, now my AR6002-based card is working with your patches. At
least it seems to be working - my antenna cable is broken so I can
unfortunately not do any more proper than a simple "iwlist wlan0
scan". Good thing is that the SDIO IRQ mode and polling mode seem to
behave about the same.

Please note that I did not test using the upstream driver. I couldn't
get that one working last week, so today I reverted to using my last
known working configuration - the out-of-tree "ar69_sdk" driver
pointed out by the following instructions:
http://armin762.wordpress.com/2010/05/24/nvidia-tegra2-getting-wifiatheros-6002-working/

Anyway, I'm all for including your SDIO IRQ patches, but I think that
they should be reworked a bit.

I propose using two flags:

1) A hardware-has-sdio-irq-support flag for include/linux/mfd/tmio.h,
perhaps TMIO_MMC_SDIO_IRQ

The SDIO IRQ hardware registers are only touched when tmio-mmc is
provided the TMIO_MMC_SDIO_IRQ flag. The default behavior would be to
mask the SDIO IRQ interrupt source regardless of the MMC_CAP_SDIO_IRQ
flag. This should allow us to always enable the SDIO IRQ interrupt
source in INTC. The SDIO driver should set the TMIO_MMC_SDIO_IRQ flag
to show that SDHI is known to support SDIO IRQ.

Hopefully this TMIO_MMC_SDIO_IRQ flag will make it easier for Ian to
review the code and see that it doesn't break any other platforms that
may or may not lack SDIO IRQ support.

2) The regular MMC_CAP_SDIO_IRQ flag.

This is enabled per board. If the SDIO IRQ feature doesn't work in
some case then the system integrator can simply just simply go back to
polled mode by not setting MMC_CAP_SIDO_IRQ.

I'm not sure if we can keep the SDIO IRQ interrupt source constantly
enabled in INTC though. Your current patches require the board
specific MMC_CAP_SDIO_IRQ flag to be paired with the cpu-specific INTC
enable change. If someone wishes tho disable SDIO_IRQ support for
their board then they must know that they also need to revert the INTC
enable bits, otherwise they'll get endless interrupts when the
tmio-mmc driver starts. I believe the two-flag approach above will
solve this problem.

Thanks,

/ magnus

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
  2010-12-20  3:58             ` Magnus Damm
@ 2010-12-20 15:51               ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:51 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Magnus,

Am 20.12.2010 04:58, schrieb Magnus Damm:
> Hi again Arnd,
> 
> On Wed, Dec 15, 2010 at 12:44 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> On Wed, Dec 8, 2010 at 12:08 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>> Am 07.12.2010 09:37, schrieb Magnus Damm:
>>>> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>>>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>>>> This patch implements SDIO IRQ support for mfds which
>>>>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>>>>
>>>>>>> This patch applies on top of:
>>>>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>>>>> mmc: tmio: merge the private header into the driver
>>>>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>>>>
>>>>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>>>> ---
>>>>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>>>>
> 
>>>> I'll try to find my AR6002 card, maybe that will shed some light...
>>>
>>> Yeah, that would be really cool.
>>
>> I'll try again next time I have a bit of time to spare. =)
> 
> Alright, now my AR6002-based card is working with your patches. At
> least it seems to be working - my antenna cable is broken so I can
> unfortunately not do any more proper than a simple "iwlist wlan0
> scan". Good thing is that the SDIO IRQ mode and polling mode seem to
> behave about the same.
> 
> Please note that I did not test using the upstream driver. I couldn't
> get that one working last week, so today I reverted to using my last
> known working configuration - the out-of-tree "ar69_sdk" driver
> pointed out by the following instructions:
> http://armin762.wordpress.com/2010/05/24/nvidia-tegra2-getting-wifiatheros-6002-working/

Thanks for testing!

> 
> Anyway, I'm all for including your SDIO IRQ patches, but I think that
> they should be reworked a bit.
> 
> I propose using two flags:
> 
> 1) A hardware-has-sdio-irq-support flag for include/linux/mfd/tmio.h,
> perhaps TMIO_MMC_SDIO_IRQre
> 
> The SDIO IRQ hardware registers are only touched when tmio-mmc is
> provided the TMIO_MMC_SDIO_IRQ flag. The default behavior would be to
> mask the SDIO IRQ interrupt source regardless of the MMC_CAP_SDIO_IRQ
> flag. This should allow us to always enable the SDIO IRQ interrupt
> source in INTC. The SDIO driver should set the TMIO_MMC_SDIO_IRQ flag
> to show that SDHI is known to support SDIO IRQ.
> 
> Hopefully this TMIO_MMC_SDIO_IRQ flag will make it easier for Ian to
> review the code and see that it doesn't break any other platforms that
> may or may not lack SDIO IRQ support.
> 
> 2) The regular MMC_CAP_SDIO_IRQ flag.
> 
> This is enabled per board. If the SDIO IRQ feature doesn't work in
> some case then the system integrator can simply just simply go back to
> polled mode by not setting MMC_CAP_SIDO_IRQ.
> 
> I'm not sure if we can keep the SDIO IRQ interrupt source constantly
> enabled in INTC though. Your current patches require the board
> specific MMC_CAP_SDIO_IRQ flag to be paired with the cpu-specific INTC
> enable change. If someone wishes tho disable SDIO_IRQ support for
> their board then they must know that they also need to revert the INTC
> enable bits, otherwise they'll get endless interrupts when the
> tmio-mmc driver starts. I believe the two-flag approach above will
> solve this problem.

This makes sense, I'll shortly post a revised patchset implementing
your idea...

Thanks,
Arnd

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

* Re: [PATCH 1/4] mmc: tmio: Implement SDIO IRQ
@ 2010-12-20 15:51               ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:51 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Magnus,

Am 20.12.2010 04:58, schrieb Magnus Damm:
> Hi again Arnd,
> 
> On Wed, Dec 15, 2010 at 12:44 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> On Wed, Dec 8, 2010 at 12:08 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>> Am 07.12.2010 09:37, schrieb Magnus Damm:
>>>> On Tue, Dec 7, 2010 at 9:22 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>> Am 07.12.2010 00:39, schrieb Magnus Damm:
>>>>>> On Tue, Dec 7, 2010 at 2:35 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
>>>>>>> This patch implements SDIO IRQ support for mfds which
>>>>>>> announce the MMC_CAP_SDIO_IRQ capability for tmio_mmc.
>>>>>>> Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.
>>>>>>>
>>>>>>> This patch applies on top of:
>>>>>>> mmc: tmio_mmc: allow multi-element scatter-gather lists
>>>>>>> mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
>>>>>>> mmc: tmio: merge the private header into the driver
>>>>>>> mmc: tmio: implement a bounce buffer for unaligned DMA
>>>>>>>
>>>>>>> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
>>>>>>> CC: Ian Molton <ian@mnementh.co.uk>
>>>>>>> CC: Samuel Ortiz <sameo@linux.intel.com>
>>>>>>> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>>>>>> ---
>>>>>>>  drivers/mmc/host/tmio_mmc.c |   54 ++++++++++++++++++++++++++++++++++++++++++-
>>>>>>>  1 files changed, 53 insertions(+), 1 deletions(-)
>>>>>>
> 
>>>> I'll try to find my AR6002 card, maybe that will shed some light...
>>>
>>> Yeah, that would be really cool.
>>
>> I'll try again next time I have a bit of time to spare. =)
> 
> Alright, now my AR6002-based card is working with your patches. At
> least it seems to be working - my antenna cable is broken so I can
> unfortunately not do any more proper than a simple "iwlist wlan0
> scan". Good thing is that the SDIO IRQ mode and polling mode seem to
> behave about the same.
> 
> Please note that I did not test using the upstream driver. I couldn't
> get that one working last week, so today I reverted to using my last
> known working configuration - the out-of-tree "ar69_sdk" driver
> pointed out by the following instructions:
> http://armin762.wordpress.com/2010/05/24/nvidia-tegra2-getting-wifiatheros-6002-working/

Thanks for testing!

> 
> Anyway, I'm all for including your SDIO IRQ patches, but I think that
> they should be reworked a bit.
> 
> I propose using two flags:
> 
> 1) A hardware-has-sdio-irq-support flag for include/linux/mfd/tmio.h,
> perhaps TMIO_MMC_SDIO_IRQre
> 
> The SDIO IRQ hardware registers are only touched when tmio-mmc is
> provided the TMIO_MMC_SDIO_IRQ flag. The default behavior would be to
> mask the SDIO IRQ interrupt source regardless of the MMC_CAP_SDIO_IRQ
> flag. This should allow us to always enable the SDIO IRQ interrupt
> source in INTC. The SDIO driver should set the TMIO_MMC_SDIO_IRQ flag
> to show that SDHI is known to support SDIO IRQ.
> 
> Hopefully this TMIO_MMC_SDIO_IRQ flag will make it easier for Ian to
> review the code and see that it doesn't break any other platforms that
> may or may not lack SDIO IRQ support.
> 
> 2) The regular MMC_CAP_SDIO_IRQ flag.
> 
> This is enabled per board. If the SDIO IRQ feature doesn't work in
> some case then the system integrator can simply just simply go back to
> polled mode by not setting MMC_CAP_SIDO_IRQ.
> 
> I'm not sure if we can keep the SDIO IRQ interrupt source constantly
> enabled in INTC though. Your current patches require the board
> specific MMC_CAP_SDIO_IRQ flag to be paired with the cpu-specific INTC
> enable change. If someone wishes tho disable SDIO_IRQ support for
> their board then they must know that they also need to revert the INTC
> enable bits, otherwise they'll get endless interrupts when the
> tmio-mmc driver starts. I believe the two-flag approach above will
> solve this problem.

This makes sense, I'll shortly post a revised patchset implementing
your idea...

Thanks,
Arnd

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

* [PATCH 0/6 v2] mmc: tmio: Add SDIO IRQ support
  2010-12-20  3:58             ` Magnus Damm
  (?)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  2010-12-22 13:54                 ` Magnus Damm
  -1 siblings, 1 reply; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

[PATCH 1/6 v2] mmc: tmio: implement SDIO IRQ
[PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
[PATCH 3/6 v2] mmc: tmio: disable IRQs early in remove
[PATCH 4/6 v2] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
[PATCH 5/6 v2] sh: sh7724 Enable SDIO IRQs
[PATCH 6/6 v2] [RFC] sh: sh7722 Enable SDIO IRQs

These patches add SDIO IRQ support for the tmio mmc cell
of the sh_mobile_sdhi mfd and activate the usage of
SDIO IRQs on all SoCs where sh_mobile_sdhi is currently
used.

Changes since the earlier patchset:
- Add TMIO_MMC_SDIO_IRQ flag, which expresses that  the hardware is known
  to support SDIO IRQ as suggested by Magnus Damm
- Activate this flag for sh_mobile_sdhi
- Add a patch which disables IRQs early in remove
  to avoid spurious SDIO IRQs, during module unload
- Patches 4-6 are unmodified but included for
  completeness

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>

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

* [PATCH 1/6 v2] mmc: tmio: implement SDIO IRQ
  2010-12-20  3:58             ` Magnus Damm
                               ` (2 preceding siblings ...)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

This patch implements SDIO IRQ support for mfds which
announce the TMIO_MMC_SDIO_IRQ flag for tmio_mmc.
If MMC_CAP_SDIO_IRQ is also set SDIO IRQ signalling is activated.
Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.

This patch applies on top of:
mmc: tmio_mmc: allow multi-element scatter-gather lists
mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
mmc: tmio: merge the private header into the driver
mmc: tmio: implement a bounce buffer for unaligned DMA

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
Changes in v2:
 - added TMIO_MMC_SDIO_IRQ flag to support the case where SDIO IRQ
   interrupts are generated but SDIO IRQ signalling to the core
   should not be used
 - rearranged code, so that either an SDIO IRQ or a normal IRQ is
   handled, this marginally increases interrupt load, but preserves
   the current timing, which seems to be crucial for DMA handling

 drivers/mmc/host/tmio_mmc.c |   61 ++++++++++++++++++++++++++++++++++++++++++-
 include/linux/mfd/tmio.h    |    4 +++
 2 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 57ece9d..18771b4 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -53,6 +53,8 @@
 #define CTL_SD_ERROR_DETAIL_STATUS 0x2c
 #define CTL_SD_DATA_PORT 0x30
 #define CTL_TRANSACTION_CTL 0x34
+#define CTL_SDIO_STATUS 0x36
+#define CTL_SDIO_IRQ_MASK 0x38
 #define CTL_RESET_SD 0xe0
 #define CTL_SDIO_REGS 0x100
 #define CTL_CLK_AND_WAIT_CTL 0x138
@@ -81,6 +83,12 @@
 #define TMIO_STAT_CMD_BUSY      0x40000000
 #define TMIO_STAT_ILL_ACCESS    0x80000000
 
+/* Definitions for values the CTRL_SDIO_STATUS register can take. */
+#define TMIO_SDIO_STAT_IOIRQ	0x0001
+#define TMIO_SDIO_STAT_EXPUB52	0x4000
+#define TMIO_SDIO_STAT_EXWT	0x8000
+#define TMIO_SDIO_MASK_ALL	0xc007
+
 /* Define some IRQ masks */
 /* This is the mask used at reset by the chip */
 #define TMIO_MASK_ALL           0x837f031d
@@ -122,6 +130,7 @@ struct tmio_mmc_host {
 	struct mmc_data         *data;
 	struct mmc_host         *mmc;
 	int                     irq;
+	unsigned int		sdio_irq_enabled;
 
 	/* Callbacks for clock / power control */
 	void (*set_pwr)(struct platform_device *host, int state);
@@ -247,6 +256,22 @@ void pr_debug_status(u32 status)
 #define pr_debug_status(s)  do { } while (0)
 #endif
 
+static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+	struct tmio_mmc_host *host = mmc_priv(mmc);
+
+	if (enable) {
+		host->sdio_irq_enabled = 1;
+		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0001);
+		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK,
+		(TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ));
+	} else {
+		sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, TMIO_SDIO_MASK_ALL);
+		sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000);
+		host->sdio_irq_enabled = 0;
+	}
+}
+
 static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 {
 	u32 clk = 0, clock;
@@ -275,10 +300,16 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
 
 static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
 {
+	struct mfd_cell *cell = host->pdev->dev.platform_data;
+	struct tmio_mmc_data *pdata = cell->driver_data;
+
 	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
 		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
 	msleep(10);
 	sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
+	/* restore sdio irq state */
+	if (pdata->flags & TMIO_MMC_SDIO_IRQ)
+		tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
 	msleep(10);
 }
 
@@ -556,7 +587,10 @@ static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
 static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 {
 	struct tmio_mmc_host *host = devid;
+	struct mfd_cell	*cell = host->pdev->dev.platform_data;
+	struct tmio_mmc_data *pdata = cell->driver_data;
 	unsigned int ireg, irq_mask, status;
+	unsigned int sdio_ireg, sdio_irq_mask, sdio_status;
 
 	pr_debug("MMC IRQ begin\n");
 
@@ -564,10 +598,33 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
 	irq_mask = sd_ctrl_read32(host, CTL_IRQ_MASK);
 	ireg = status & TMIO_MASK_IRQ & ~irq_mask;
 
+	sdio_ireg = 0;
+	if (!ireg && pdata->flags & TMIO_MMC_SDIO_IRQ) {
+		sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
+		sdio_irq_mask = sd_ctrl_read16(host, CTL_SDIO_IRQ_MASK);
+		sdio_ireg = sdio_status & TMIO_SDIO_MASK_ALL & ~sdio_irq_mask;
+
+		sd_ctrl_write16(host, CTL_SDIO_STATUS, sdio_status & ~TMIO_SDIO_MASK_ALL);
+
+		if (sdio_ireg && !host->sdio_irq_enabled) {
+			pr_warning("tmio_mmc: Spurious SDIO IRQ, disabling! 0x%04x 0x%04x 0x%04x\n",
+				sdio_status, sdio_irq_mask, sdio_ireg);
+			tmio_mmc_enable_sdio_irq(host, 0);
+			goto out;
+		}
+
+		if (host->mmc->caps & MMC_CAP_SDIO_IRQ &&
+			sdio_ireg & TMIO_SDIO_STAT_IOIRQ)
+			mmc_signal_sdio_irq(host->mmc);
+
+		if (sdio_ireg)
+			goto out;
+	}
+
 	pr_debug_status(status);
 	pr_debug_status(ireg);
 
 	if (!ireg) {
 		disable_mmc_irqs(host, status & ~irq_mask);
 
 		pr_warning("tmio_mmc: Spurious irq, disabling! "
@@ -1033,6 +1089,7 @@ static const struct mmc_host_ops tmio_mmc_ops = {
 	.set_ios	= tmio_mmc_set_ios,
 	.get_ro         = tmio_mmc_get_ro,
 	.get_cd		= tmio_mmc_get_cd,
+	.enable_sdio_irq = tmio_mmc_enable_sdio_irq,
 };
 
 #ifdef CONFIG_PM
@@ -1147,6 +1204,8 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 		goto cell_disable;
 
 	disable_mmc_irqs(host, TMIO_MASK_ALL);
+	if (pdata->flags & TMIO_MMC_SDIO_IRQ)
+		tmio_mmc_enable_sdio_irq(mmc, 0);
 
 	ret = request_irq(host->irq, tmio_mmc_irq, IRQF_DISABLED |
 		IRQF_TRIGGER_FALLING, dev_name(&dev->dev), host);
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index dbfc053..8e70310 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -57,6 +57,10 @@
  * is configured in 4-bit mode.
  */
 #define TMIO_MMC_BLKSZ_2BYTES		(1 << 1)
+/*
+ * Some controllers can support SDIO IRQ signalling.
+ */
+#define TMIO_MMC_SDIO_IRQ		(1 << 2)
 
 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);
-- 
1.7.2.3


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

* [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
  2010-12-20  3:58             ` Magnus Damm
                               ` (3 preceding siblings ...)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  2010-12-24 11:03                 ` [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Samuel Ortiz
  -1 siblings, 1 reply; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

The SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling.
This patch advertises this fact to the tmio_mmc driver.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 drivers/mfd/sh_mobile_sdhi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index 3ca20ec..0a7df44 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -131,6 +131,11 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
 	 */
 	mmc_data->flags |= TMIO_MMC_BLKSZ_2BYTES;
 
+	/*
+	 * All SDHI blocks support SDIO IRQ signalling.
+	 */
+	mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
+
 	if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
 		priv->param_tx.slave_id = p->dma_slave_tx;
 		priv->param_rx.slave_id = p->dma_slave_rx;
-- 
1.7.2.3


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

* [PATCH 3/6 v2] mmc: tmio: disable IRQs early in remove
  2010-12-20  3:58             ` Magnus Damm
                               ` (4 preceding siblings ...)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

With SDIO IRQ, spurious interrupts are generated on
module unloading.

This patch fixes that by disabling IRQs early.
Tested with a b43-based wireless SDIO card and sh_mobile_sdhi.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 drivers/mmc/host/tmio_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 18771b4..37721aa 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -1249,9 +1249,9 @@ static int __devexit tmio_mmc_remove(struct platform_device *dev)
 
 	if (mmc) {
 		struct tmio_mmc_host *host = mmc_priv(mmc);
-		mmc_remove_host(mmc);
 		tmio_mmc_release_dma(host);
 		free_irq(host->irq, host);
+		mmc_remove_host(mmc);
 		if (cell->disable)
 			cell->disable(dev);
 		iounmap(host->ctl);
-- 
1.7.2.3


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

* [PATCH 4/6 v2] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
  2010-12-20  3:58             ` Magnus Damm
                               ` (5 preceding siblings ...)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure interrupts
are handled announce the MMC_CAP_SDIO_IRQ capability
on AP4EVB. Tested with a b43-based SDIO wireless card.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/arm/mach-shmobile/board-ap4evb.c |    3 ++-
 arch/arm/mach-shmobile/intc-sh7372.c  |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 16eba07..5763b0d 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -310,6 +310,7 @@ static u64 sdhi0_dma_mask = DMA_BIT_MASK(32);
 static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps	= MMC_CAP_SDIO_IRQ,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -344,7 +345,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
 	.tmio_ocr_mask	= MMC_VDD_165_195,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
-	.tmio_caps	= MMC_CAP_NEEDS_POLL,
+	.tmio_caps	= MMC_CAP_NEEDS_POLL | MMC_CAP_SDIO_IRQ,
 	.get_cd		= slot_cn7_get_cd,
 };
 
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 30b2f40..f78a1ea 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -230,10 +230,10 @@ static struct intc_mask_reg intca_mask_registers[] __initdata = {
 	  { SCIFB, SCIFA5, SCIFA4, MSIOF1,
 	    0, 0, MSIOF2, 0 } },
 	{ 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
-	  { DISABLED, DISABLED, ENABLED, ENABLED,
+	  { DISABLED, ENABLED, ENABLED, ENABLED,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
 	{ 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
-	  { 0, DISABLED, ENABLED, ENABLED,
+	  { 0, ENABLED, ENABLED, ENABLED,
 	    TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
 	{ 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
 	  { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
-- 
1.7.2.3


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

* [PATCH 5/6 v2] sh: sh7724 Enable SDIO IRQs
  2010-12-20  3:58             ` Magnus Damm
                               ` (6 preceding siblings ...)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  -1 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure interrupt
are handled announce the MMC_CAP_SDIO_IRQ capability
on ecovec, kfr2r09 and se7724.

Tested with a b43-based SDIO wireless card on ecovec.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-ecovec24/setup.c   |    2 ++
 arch/sh/boards/mach-kfr2r09/setup.c    |    1 +
 arch/sh/boards/mach-se/7724/setup.c    |    2 ++
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c |    4 ++--
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 4e0e65a..36d7ca7 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -476,6 +476,7 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.set_pwr	= sdhi0_set_pwr,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -517,6 +518,7 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state)
 static struct sh_mobile_sdhi_info sdhi1_info = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 	.set_pwr	= sdhi1_set_pwr,
 };
 
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 1423aa3..4e2eefe 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -369,6 +369,7 @@ static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 	.tmio_flags	= TMIO_MMC_WRPROTECT_DISABLE,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device kfr2r09_sh_sdhi0_device = {
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index ab187c9..4eeb7c7 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -470,6 +470,7 @@ static struct resource sdhi0_cn7_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi0_cn7_device = {
@@ -504,6 +505,7 @@ static struct resource sdhi1_cn8_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi1_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI1_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI1_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi1_cn8_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 828c965..c598a7f 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -1144,7 +1144,7 @@ static struct intc_group groups[] __initdata = {
 static struct intc_mask_reg mask_registers[] __initdata = {
 	{ 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
 	  { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
-	    0, DISABLED, ENABLED, ENABLED } },
+	    0, ENABLED, ENABLED, ENABLED } },
 	{ 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
 	  { VIO_VOU, VIO_VEU1, VIO_BEU0, VIO_CEU0,
 	    DMAC0A_DEI3, DMAC0A_DEI2, DMAC0A_DEI1, DMAC0A_DEI0 } },
@@ -1166,7 +1166,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C0_DTEI, I2C0_WAITI, I2C0_TACKI, I2C0_ALI,
 	    I2C1_DTEI, I2C1_WAITI, I2C1_TACKI, I2C1_ALI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED,
+	  { DISABLED, ENABLED, ENABLED, ENABLED,
 	    0, 0, SCIFA5, FSI } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB1, USB0, 0 } },
-- 
1.7.2.3


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

* [PATCH 6/6 v2] [RFC] sh: sh7722 Enable SDIO IRQs
  2010-12-20  3:58             ` Magnus Damm
                               ` (7 preceding siblings ...)
  (?)
@ 2010-12-20 15:53             ` Arnd Hannemann
  2010-12-23 10:42               ` [PATCH 6/6 v3] " Arnd Hannemann
  -1 siblings, 1 reply; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-20 15:53 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the soc. To make sure SDIO IRQs
are used announce the MMC_CAP_SDIO_IRQ capability
on migor. Untested, therefore RFC.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-migor/setup.c      |    1 +
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 5dc72b4..b9cba53 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -413,6 +413,7 @@ static struct resource sdhi_cn9_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi_cn9_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index d551ed8..a164f89 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -699,7 +699,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
+	  { DISABLED, ENABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } },
 	{ 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
-- 
1.7.2.3


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

* Re: [PATCH 0/6 v2] mmc: tmio: Add SDIO IRQ support
  2010-12-20 15:53             ` [PATCH 0/6 v2] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
@ 2010-12-22 13:54                 ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-22 13:54 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

On Tue, Dec 21, 2010 at 12:53 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> [PATCH 1/6 v2] mmc: tmio: implement SDIO IRQ
> [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
> [PATCH 3/6 v2] mmc: tmio: disable IRQs early in remove
> [PATCH 4/6 v2] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
> [PATCH 5/6 v2] sh: sh7724 Enable SDIO IRQs
> [PATCH 6/6 v2] [RFC] sh: sh7722 Enable SDIO IRQs
>
> These patches add SDIO IRQ support for the tmio mmc cell
> of the sh_mobile_sdhi mfd and activate the usage of
> SDIO IRQs on all SoCs where sh_mobile_sdhi is currently
> used.
>
> Changes since the earlier patchset:
> - Add TMIO_MMC_SDIO_IRQ flag, which expresses that  the hardware is known
>  to support SDIO IRQ as suggested by Magnus Damm
> - Activate this flag for sh_mobile_sdhi
> - Add a patch which disables IRQs early in remove
>  to avoid spurious SDIO IRQs, during module unload
> - Patches 4-6 are unmodified but included for
>  completeness
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>

Looking good, this patch series:

Acked-by: Magnus Damm <damm@opensource.se>

Feel free to hack up support for sh7723 as well if you have time! =)

Cheers,

/ magnus

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

* Re: [PATCH 0/6 v2] mmc: tmio: Add SDIO IRQ support
@ 2010-12-22 13:54                 ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-22 13:54 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

On Tue, Dec 21, 2010 at 12:53 AM, Arnd Hannemann <arnd@arndnet.de> wrote:
> [PATCH 1/6 v2] mmc: tmio: implement SDIO IRQ
> [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
> [PATCH 3/6 v2] mmc: tmio: disable IRQs early in remove
> [PATCH 4/6 v2] ARM: mach-shmobile: sh7372 Enable SDIO IRQs
> [PATCH 5/6 v2] sh: sh7724 Enable SDIO IRQs
> [PATCH 6/6 v2] [RFC] sh: sh7722 Enable SDIO IRQs
>
> These patches add SDIO IRQ support for the tmio mmc cell
> of the sh_mobile_sdhi mfd and activate the usage of
> SDIO IRQs on all SoCs where sh_mobile_sdhi is currently
> used.
>
> Changes since the earlier patchset:
> - Add TMIO_MMC_SDIO_IRQ flag, which expresses that  the hardware is known
>  to support SDIO IRQ as suggested by Magnus Damm
> - Activate this flag for sh_mobile_sdhi
> - Add a patch which disables IRQs early in remove
>  to avoid spurious SDIO IRQs, during module unload
> - Patches 4-6 are unmodified but included for
>  completeness
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>

Looking good, this patch series:

Acked-by: Magnus Damm <damm@opensource.se>

Feel free to hack up support for sh7723 as well if you have time! =)

Cheers,

/ magnus

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

* [PATCH 6/6 v3] [RFC] sh: sh7722 Enable SDIO IRQs
  2010-12-20 15:53             ` [PATCH 6/6 v2] [RFC] sh: sh7722 " Arnd Hannemann
@ 2010-12-23 10:42               ` Arnd Hannemann
  0 siblings, 0 replies; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-23 10:42 UTC (permalink / raw)
  Cc: Magnus Damm, linux-mmc, linux-sh, g.liakhovetski, Ian Molton,
	Samuel Ortiz, Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure SDIO IRQs
are used, announce the MMC_CAP_SDIO_IRQ capability
on migor. Untested, therefore RFC.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
Changes since v2:
- Added missing include

 arch/sh/boards/mach-migor/setup.c      |    2 ++
 arch/sh/kernel/cpu/sh4a/setup-sh7722.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 5dc72b4..affeec4 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -14,6 +14,7 @@
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/nand.h>
 #include <linux/i2c.h>
@@ -413,6 +414,7 @@ static struct resource sdhi_cn9_resources[] = {
 static struct sh_mobile_sdhi_info sh7724_sdhi_data = {
 	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
 	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
 };
 
 static struct platform_device sdhi_cn9_device = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index d551ed8..a164f89 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -699,7 +699,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLENDI, FLCTL_FLSTEI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { DISABLED, DISABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
+	  { DISABLED, ENABLED, ENABLED, ENABLED, 0, 0, TWODG, SIU } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT, 0, USB_USBI1, USB_USBI0, } },
 	{ 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
-- 
1.7.2.3


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

* [PATCH] [RFC] sh: sh7723 / ap325rxa enable SDIO IRQs
  2010-12-22 13:54                 ` Magnus Damm
  (?)
@ 2010-12-23 10:45                 ` Arnd Hannemann
  2010-12-28 10:01                     ` Magnus Damm
  -1 siblings, 1 reply; 37+ messages in thread
From: Arnd Hannemann @ 2010-12-23 10:45 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz,
	Arnd Hannemann

This patch enables the interrupt generation for SDIO IRQs
of the sdhi controllers of the SoC. To make sure SDIO IRQs
are used announce the MMC_CAP_SDIO_IRQ capability
on ap325rxa. Untested, therefore RFC.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 arch/sh/boards/mach-ap325rxa/setup.c   |   16 ++++++++++++++++
 arch/sh/kernel/cpu/sh4a/setup-sh7723.c |    4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 07ea908..3e5fc3b 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -14,6 +14,8 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/sh_flctl.h>
 #include <linux/delay.h>
@@ -430,11 +432,18 @@ static struct resource sdhi0_cn3_resources[] = {
 	},
 };
 
+static struct sh_mobile_sdhi_info sdhi0_cn3_data = {
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
+};
+
 static struct platform_device sdhi0_cn3_device = {
 	.name		= "sh_mobile_sdhi",
 	.id             = 0, /* "sdhi0" clock */
 	.num_resources	= ARRAY_SIZE(sdhi0_cn3_resources),
 	.resource	= sdhi0_cn3_resources,
+	.dev = {
+		.platform_data = &sdhi0_cn3_data,
+	},
 	.archdata = {
 		.hwblk_id = HWBLK_SDHI0,
 	},
@@ -453,11 +462,18 @@ static struct resource sdhi1_cn7_resources[] = {
 	},
 };
 
+static struct sh_mobile_sdhi_info sdhi1_cn7_data = {
+	.tmio_caps      = MMC_CAP_SDIO_IRQ,
+};
+
 static struct platform_device sdhi1_cn7_device = {
 	.name		= "sh_mobile_sdhi",
 	.id             = 1, /* "sdhi1" clock */
 	.num_resources	= ARRAY_SIZE(sdhi1_cn7_resources),
 	.resource	= sdhi1_cn7_resources,
+	.dev = {
+		.platform_data = &sdhi1_cn7_data,
+	},
 	.archdata = {
 		.hwblk_id = HWBLK_SDHI1,
 	},
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 0eadefd..d764122 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -719,7 +719,7 @@ static struct intc_group groups[] __initdata = {
 static struct intc_mask_reg mask_registers[] __initdata = {
 	{ 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
 	  { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
-	    0, DISABLED, ENABLED, ENABLED } },
+	    0, ENABLED, ENABLED, ENABLED } },
 	{ 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
 	  { VIO_VOUI, VIO_VEU2HI,VIO_BEUI,VIO_CEUI,DMAC0A_DEI3,DMAC0A_DEI2,DMAC0A_DEI1,DMAC0A_DEI0 } },
 	{ 0xa4080088, 0xa40800c8, 8, /* IMR2 / IMCR2 */
@@ -736,7 +736,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 	  { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
 	    FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
 	{ 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
-	  { 0, DISABLED, ENABLED, ENABLED,
+	  { 0, ENABLED, ENABLED, ENABLED,
 	    0, 0, SCIFA_SCIFA2, SIU_SIUI } },
 	{ 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
 	  { 0, 0, 0, CMT_CMTI, 0, 0, USB_USI0,0 } },
-- 
1.7.2.3


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

* Re: [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for
  2010-12-20 15:53             ` [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Arnd Hannemann
@ 2010-12-24 11:03                 ` Samuel Ortiz
  0 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2010-12-24 11:03 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: Magnus Damm, linux-mmc, linux-sh, g.liakhovetski, Ian Molton

Hi Arnd,

On Mon, Dec 20, 2010 at 03:53:47PM +0000, Arnd Hannemann wrote:
> The SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling.
> This patch advertises this fact to the tmio_mmc driver.
> 
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Since this one depends on the first patch on the series, I won't be able to
carry it. Please add my:

Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc
@ 2010-12-24 11:03                 ` Samuel Ortiz
  0 siblings, 0 replies; 37+ messages in thread
From: Samuel Ortiz @ 2010-12-24 11:03 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: Magnus Damm, linux-mmc, linux-sh, g.liakhovetski, Ian Molton

Hi Arnd,

On Mon, Dec 20, 2010 at 03:53:47PM +0000, Arnd Hannemann wrote:
> The SDHI Controller on SH-Mobile SoCs supports SDIO IRQ signalling.
> This patch advertises this fact to the tmio_mmc driver.
> 
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Since this one depends on the first patch on the series, I won't be able to
carry it. Please add my:

Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

* Re: [PATCH] [RFC] sh: sh7723 / ap325rxa enable SDIO IRQs
  2010-12-23 10:45                 ` [PATCH] [RFC] sh: sh7723 / ap325rxa enable SDIO IRQs Arnd Hannemann
@ 2010-12-28 10:01                     ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-28 10:01 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Arnd,

On Thu, Dec 23, 2010 at 7:45 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
> This patch enables the interrupt generation for SDIO IRQs
> of the sdhi controllers of the SoC. To make sure SDIO IRQs
> are used announce the MMC_CAP_SDIO_IRQ capability
> on ap325rxa. Untested, therefore RFC.
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>

Looking good, thanks a lot!

Acked-by: Magnus Damm <damm@opensource.se>

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

* Re: [PATCH] [RFC] sh: sh7723 / ap325rxa enable SDIO IRQs
@ 2010-12-28 10:01                     ` Magnus Damm
  0 siblings, 0 replies; 37+ messages in thread
From: Magnus Damm @ 2010-12-28 10:01 UTC (permalink / raw)
  To: Arnd Hannemann
  Cc: linux-mmc, linux-sh, g.liakhovetski, Ian Molton, Samuel Ortiz

Hi Arnd,

On Thu, Dec 23, 2010 at 7:45 PM, Arnd Hannemann <arnd@arndnet.de> wrote:
> This patch enables the interrupt generation for SDIO IRQs
> of the sdhi controllers of the SoC. To make sure SDIO IRQs
> are used announce the MMC_CAP_SDIO_IRQ capability
> on ap325rxa. Untested, therefore RFC.
>
> Signed-off-by: Arnd Hannemann <arnd@arndnet.de>

Looking good, thanks a lot!

Acked-by: Magnus Damm <damm@opensource.se>

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

end of thread, other threads:[~2010-12-28 10:01 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-06 17:35 [PATCH 1/4] mmc: tmio: Implement SDIO IRQ Arnd Hannemann
2010-12-06 17:35 ` Arnd Hannemann
2010-12-06 17:35 ` [PATCH 2/4] ARM: mach-shmobile: sh7372 Enable SDIO IRQs Arnd Hannemann
2010-12-06 17:35   ` Arnd Hannemann
2010-12-06 17:35 ` [PATCH 3/4] sh: sh7724 " Arnd Hannemann
2010-12-06 17:35   ` Arnd Hannemann
2010-12-06 17:35 ` [PATCH 4/4] [RFC] sh: sh7722 " Arnd Hannemann
2010-12-06 17:35   ` Arnd Hannemann
2010-12-07  5:39 ` [PATCH 1/4] mmc: tmio: Implement SDIO IRQ Magnus Damm
2010-12-07  5:39   ` Magnus Damm
2010-12-07 12:22   ` Arnd Hannemann
2010-12-07 12:22     ` Arnd Hannemann
2010-12-07 14:37     ` Magnus Damm
2010-12-07 14:37       ` Magnus Damm
2010-12-07 15:08       ` Arnd Hannemann
2010-12-07 15:08         ` Arnd Hannemann
2010-12-14 15:44         ` Magnus Damm
2010-12-14 15:44           ` Magnus Damm
2010-12-20  3:58           ` Magnus Damm
2010-12-20  3:58             ` Magnus Damm
2010-12-20 15:51             ` Arnd Hannemann
2010-12-20 15:51               ` Arnd Hannemann
2010-12-20 15:53             ` [PATCH 0/6 v2] mmc: tmio: Add SDIO IRQ support Arnd Hannemann
2010-12-22 13:54               ` Magnus Damm
2010-12-22 13:54                 ` Magnus Damm
2010-12-23 10:45                 ` [PATCH] [RFC] sh: sh7723 / ap325rxa enable SDIO IRQs Arnd Hannemann
2010-12-28 10:01                   ` Magnus Damm
2010-12-28 10:01                     ` Magnus Damm
2010-12-20 15:53             ` [PATCH 1/6 v2] mmc: tmio: implement SDIO IRQ Arnd Hannemann
2010-12-20 15:53             ` [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Arnd Hannemann
2010-12-24 11:03               ` [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for Samuel Ortiz
2010-12-24 11:03                 ` [PATCH 2/6 v2] mfd: sh_mobile_sdhi: activate SDIO IRQ for tmio_mmc Samuel Ortiz
2010-12-20 15:53             ` [PATCH 3/6 v2] mmc: tmio: disable IRQs early in remove Arnd Hannemann
2010-12-20 15:53             ` [PATCH 4/6 v2] ARM: mach-shmobile: sh7372 Enable SDIO IRQs Arnd Hannemann
2010-12-20 15:53             ` [PATCH 5/6 v2] sh: sh7724 " Arnd Hannemann
2010-12-20 15:53             ` [PATCH 6/6 v2] [RFC] sh: sh7722 " Arnd Hannemann
2010-12-23 10:42               ` [PATCH 6/6 v3] " Arnd Hannemann

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.