linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
@ 2010-02-22 14:24 David Vrabel
  2010-02-22 14:24 ` [PATCH 1/2] mmc: omap_hsmmc: don't turn SDIO cards off when idle David Vrabel
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: David Vrabel @ 2010-02-22 14:24 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-omap, madhu.cr, David Vrabel

These patches add support for SDIO cards to the omap_hsmmc driver.
Power management changes to prevent SDIO cards from being turned off
and losing all state, and card interrupts.

I've been unable to test these exact patches as I only have an N900 for 
testing and the N900 support in mainline is incomplete.

Changes since v1:
- (hopefully) get all cards working again by removing a second call to
  read MMCi_STAT in the interrupt handler.
- flush posted writes after enabling/disabling SDIO interrupts.
- tweak the FIXME commit on disabling FCLK to better match what really
  going on (at least I think so anyway).

David Vrabel (2):
  mmc: omap_hsmmc: don't turn SDIO cards off when idle
  mmc: omap_hsmmc: enable SDIO card interrupts

 drivers/mmc/host/omap_hsmmc.c |  114 ++++++++++++++++++++++++++++-------------
 1 files changed, 79 insertions(+), 35 deletions(-)


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

* [PATCH 1/2] mmc: omap_hsmmc: don't turn SDIO cards off when idle
  2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
@ 2010-02-22 14:24 ` David Vrabel
  2010-02-22 14:24 ` [PATCH 2/2] mmc: omap_hsmmc: enable SDIO card interrupts David Vrabel
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 29+ messages in thread
From: David Vrabel @ 2010-02-22 14:24 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-omap, madhu.cr, David Vrabel

Don't turn SDIO cards off to save power.  Doing so will lose all
internal state in the card.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
---
 drivers/mmc/host/omap_hsmmc.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4b23225..323a0e8 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -28,6 +28,7 @@
 #include <linux/clk.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/core.h>
+#include <linux/mmc/card.h>
 #include <linux/io.h>
 #include <linux/semaphore.h>
 #include <plat/dma.h>
@@ -1366,8 +1367,12 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
 	      mmc_slot(host).card_detect ||
 	      (mmc_slot(host).get_cover_state &&
 	       mmc_slot(host).get_cover_state(host->dev, host->slot_id)))) {
-		mmc_release_host(host->mmc);
-		return 0;
+		goto out;
+	}
+
+	/* Don't turn SDIO cards off. */
+	if (host->mmc->card && mmc_card_sdio(host->mmc->card)) {
+		goto out;
 	}
 
 	mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
@@ -1378,9 +1383,8 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
 		host->dpm_state == CARDSLEEP ? "CARDSLEEP" : "REGSLEEP");
 
 	host->dpm_state = OFF;
-
+out:
 	mmc_release_host(host->mmc);
-
 	return 0;
 }
 
-- 
1.6.3.3


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

* [PATCH 2/2] mmc: omap_hsmmc: enable SDIO card interrupts
  2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
  2010-02-22 14:24 ` [PATCH 1/2] mmc: omap_hsmmc: don't turn SDIO cards off when idle David Vrabel
@ 2010-02-22 14:24 ` David Vrabel
  2010-02-22 14:55 ` [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) Felipe Contreras
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 29+ messages in thread
From: David Vrabel @ 2010-02-22 14:24 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-omap, madhu.cr, David Vrabel

Enable the use of SDIO card interrupts.

FCLK must be enabled while SDIO interrupts are enabled or the MMC
module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in
HTCL have been set).  Enabling the MMC module to wake-up would require
configuring the MMC module (and the mmci_dat[1] GPIO when the CORE
power domain is OFF) as wake-up sources in the PRCM.

The writes to STAT and ISE when starting a command are unnecessary and
have been removed.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
---
 drivers/mmc/host/omap_hsmmc.c |  102 ++++++++++++++++++++++++++++------------
 1 files changed, 71 insertions(+), 31 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 323a0e8..278b551 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -64,6 +64,7 @@
 #define SDVS_MASK		0x00000E00
 #define SDVSCLR			0xFFFFF1FF
 #define SDVSDET			0x00000400
+#define ENAWAKEUP		(1 << 2)
 #define AUTOIDLE		0x1
 #define SDBP			(1 << 8)
 #define DTO			0xe
@@ -74,9 +75,11 @@
 #define CLKD_SHIFT		6
 #define DTO_MASK		0x000F0000
 #define DTO_SHIFT		16
+#define CIRQ_ENABLE		(1 << 8)
 #define INT_EN_MASK		0x307F0033
 #define BWR_ENABLE		(1 << 4)
 #define BRR_ENABLE		(1 << 5)
+#define CTPL			(1 << 11)
 #define INIT_STREAM		(1 << 1)
 #define DP_SELECT		(1 << 21)
 #define DDIR			(1 << 4)
@@ -84,10 +87,12 @@
 #define MSBS			(1 << 5)
 #define BCE			(1 << 1)
 #define FOUR_BIT		(1 << 1)
+#define IWE			(1 << 24)
 #define DW8			(1 << 5)
 #define CC			0x1
 #define TC			0x02
 #define OD			0x1
+#define CIRQ			(1 << 8)
 #define ERR			(1 << 15)
 #define CMD_TIMEOUT		(1 << 16)
 #define DATA_TIMEOUT		(1 << 20)
@@ -227,7 +232,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
 		;
 
 	OMAP_HSMMC_WRITE(host->base, SYSCONFIG,
-			OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE);
+			OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE | ENAWAKEUP);
 
 	if (host->id == OMAP_MMC1_DEVID) {
 		if (host->power_mode != MMC_POWER_OFF &&
@@ -242,7 +247,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
 	}
 
 	OMAP_HSMMC_WRITE(host->base, HCTL,
-			OMAP_HSMMC_READ(host->base, HCTL) | hctl);
+			OMAP_HSMMC_READ(host->base, HCTL) | hctl | IWE);
 
 	OMAP_HSMMC_WRITE(host->base, CAPA,
 			OMAP_HSMMC_READ(host->base, CAPA) | capa);
@@ -256,7 +261,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
 		;
 
 	OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
-	OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
+	OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK | CIRQ);
 	OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
 
 	/* Do not initialize card-specific things if the power is off */
@@ -425,12 +430,6 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
 		mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
 	host->cmd = cmd;
 
-	/*
-	 * Clear status bits and enable interrupts
-	 */
-	OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
-	OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
-
 	if (host->use_dma)
 		OMAP_HSMMC_WRITE(host->base, IE,
 				 INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE));
@@ -637,23 +636,26 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
 {
 	struct omap_hsmmc_host *host = dev_id;
 	struct mmc_data *data;
-	int end_cmd = 0, end_trans = 0, status;
+	u32 status;
+	int end_cmd = 0, end_trans = 0;
+	bool card_irq = false;
 
 	spin_lock(&host->irq_lock);
 
-	if (host->mrq == NULL) {
-		OMAP_HSMMC_WRITE(host->base, STAT,
-			OMAP_HSMMC_READ(host->base, STAT));
-		/* Flush posted write */
-		OMAP_HSMMC_READ(host->base, STAT);
-		spin_unlock(&host->irq_lock);
-		return IRQ_HANDLED;
-	}
-
-	data = host->data;
 	status = OMAP_HSMMC_READ(host->base, STAT);
+	OMAP_HSMMC_WRITE(host->base, STAT, status);
+	OMAP_HSMMC_READ(host->base, STAT); /* Flush posted write. */
+
 	dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
 
+	if (status & CIRQ)
+		card_irq = true;
+
+	if (host->mrq == NULL)
+		goto out;
+
+	data = host->data;
+
 	if (status & ERR) {
 #ifdef CONFIG_MMC_DEBUG
 		omap_hsmmc_report_irq(host, status);
@@ -703,17 +705,16 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
 		}
 	}
 
-	OMAP_HSMMC_WRITE(host->base, STAT, status);
-	/* Flush posted write */
-	OMAP_HSMMC_READ(host->base, STAT);
-
 	if (end_cmd || ((status & CC) && host->cmd))
 		omap_hsmmc_cmd_done(host, host->cmd);
 	if ((end_trans || (status & TC)) && host->mrq)
 		omap_hsmmc_xfer_done(host, data);
-
+out:
 	spin_unlock(&host->irq_lock);
 
+	if (card_irq)
+		mmc_signal_sdio_irq(host->mmc);
+
 	return IRQ_HANDLED;
 }
 
@@ -1255,6 +1256,45 @@ static int omap_hsmmc_get_ro(struct mmc_host *mmc)
 	return mmc_slot(host).get_ro(host->dev, 0);
 }
 
+static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+	struct omap_hsmmc_host *host = mmc_priv(mmc);
+	u32 ie, con;
+	unsigned long flags;
+
+	spin_lock_irqsave(&host->irq_lock, flags);
+
+	/*
+	 * When interrupts are enabled, CTPL must be set to enable
+	 * DAT1 input buffer (or the card interrupt is always
+	 * asserted) and FCLK must be enabled as wake-up does not
+	 * work.  Take care to disable FCLK after all the register
+	 * accesses as they might not complete if FCLK is off.
+	 *
+	 * FIXME: if the MMC module (and the mmci_dat[1] GPIO when the
+	 * CORE power domain is OFF) are configured as a wake-up
+	 * sources in the PRCM, then FCLK could be switched off.  This
+	 * might add too much latency.
+	 */
+	con = OMAP_HSMMC_READ(host->base, CON);
+	ie = OMAP_HSMMC_READ(host->base, IE);
+	if (enable) {
+		clk_enable(host->fclk);
+		ie |= CIRQ_ENABLE;
+		con |= CTPL;
+	} else {
+		ie &= ~CIRQ_ENABLE;
+		con &= ~CTPL;
+	}
+	OMAP_HSMMC_WRITE(host->base, CON, con);
+	OMAP_HSMMC_WRITE(host->base, IE, ie);
+	OMAP_HSMMC_READ(host->base, IE); /* flush posted write */
+	if (!enable)
+		clk_disable(host->fclk);
+
+	spin_unlock_irqrestore(&host->irq_lock, flags);
+}
+
 static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
 {
 	u32 hctl, capa, value;
@@ -1269,14 +1309,14 @@ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
 	}
 
 	value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
-	OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);
+	OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl | IWE);
 
 	value = OMAP_HSMMC_READ(host->base, CAPA);
 	OMAP_HSMMC_WRITE(host->base, CAPA, value | capa);
 
 	/* Set the controller to AUTO IDLE mode */
 	value = OMAP_HSMMC_READ(host->base, SYSCONFIG);
-	OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);
+	OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE | ENAWAKEUP);
 
 	/* Set SD bus power bit */
 	set_sd_bus_power(host);
@@ -1523,7 +1563,7 @@ static const struct mmc_host_ops omap_hsmmc_ops = {
 	.set_ios = omap_hsmmc_set_ios,
 	.get_cd = omap_hsmmc_get_cd,
 	.get_ro = omap_hsmmc_get_ro,
-	/* NYET -- enable_sdio_irq */
+	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
 };
 
 static const struct mmc_host_ops omap_hsmmc_ps_ops = {
@@ -1533,7 +1573,7 @@ static const struct mmc_host_ops omap_hsmmc_ps_ops = {
 	.set_ios = omap_hsmmc_set_ios,
 	.get_cd = omap_hsmmc_get_cd,
 	.get_ro = omap_hsmmc_get_ro,
-	/* NYET -- enable_sdio_irq */
+	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
 };
 
 #ifdef CONFIG_DEBUG_FS
@@ -1738,7 +1778,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
 	mmc->max_seg_size = mmc->max_req_size;
 
 	mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-		     MMC_CAP_WAIT_WHILE_BUSY;
+		     MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_SDIO_IRQ;
 
 	if (mmc_slot(host).wires >= 8)
 		mmc->caps |= MMC_CAP_8_BIT_DATA;
@@ -1809,7 +1849,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
 		}
 	}
 
-	OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
+	OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK | CIRQ);
 	OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
 
 	mmc_host_lazy_disable(host->mmc);
-- 
1.6.3.3


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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
  2010-02-22 14:24 ` [PATCH 1/2] mmc: omap_hsmmc: don't turn SDIO cards off when idle David Vrabel
  2010-02-22 14:24 ` [PATCH 2/2] mmc: omap_hsmmc: enable SDIO card interrupts David Vrabel
@ 2010-02-22 14:55 ` Felipe Contreras
  2010-02-22 15:11   ` David Vrabel
  2010-02-24 10:07 ` Mike Rapoport
  2010-08-27 19:22 ` Chris Ball
  4 siblings, 1 reply; 29+ messages in thread
From: Felipe Contreras @ 2010-02-22 14:55 UTC (permalink / raw)
  To: David Vrabel; +Cc: linux-mmc, linux-omap, madhu.cr

On Mon, Feb 22, 2010 at 4:24 PM, David Vrabel <david.vrabel@csr.com> wrote:
> These patches add support for SDIO cards to the omap_hsmmc driver.
> Power management changes to prevent SDIO cards from being turned off
> and losing all state, and card interrupts.
>
> I've been unable to test these exact patches as I only have an N900 for
> testing and the N900 support in mainline is incomplete.

Can't you get the source code with 'apt-get source' in Maemo SDK? It's
a tarball but at least it's something.

-- 
Felipe Contreras

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-02-22 14:55 ` [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) Felipe Contreras
@ 2010-02-22 15:11   ` David Vrabel
  2010-02-22 15:50     ` Felipe Contreras
  0 siblings, 1 reply; 29+ messages in thread
From: David Vrabel @ 2010-02-22 15:11 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: linux-mmc, linux-omap, madhu.cr

Felipe Contreras wrote:
> On Mon, Feb 22, 2010 at 4:24 PM, David Vrabel <david.vrabel@csr.com> wrote:
>> These patches add support for SDIO cards to the omap_hsmmc driver.
>> Power management changes to prevent SDIO cards from being turned off
>> and losing all state, and card interrupts.
>>
>> I've been unable to test these exact patches as I only have an N900 for
>> testing and the N900 support in mainline is incomplete.
> 
> Can't you get the source code with 'apt-get source' in Maemo SDK? It's
> a tarball but at least it's something.

I have SDIO cards tested and working on the N900 with the Fremantle
kernel but that's a modified 2.6.28 kernel.  These patches are for
mainline and there are differences between mainline and the fremantle
kernel that means they need different patches.

David
-- 
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-02-22 15:11   ` David Vrabel
@ 2010-02-22 15:50     ` Felipe Contreras
  0 siblings, 0 replies; 29+ messages in thread
From: Felipe Contreras @ 2010-02-22 15:50 UTC (permalink / raw)
  To: David Vrabel; +Cc: linux-mmc, linux-omap, madhu.cr

On Mon, Feb 22, 2010 at 5:11 PM, David Vrabel <david.vrabel@csr.com> wrote:
> Felipe Contreras wrote:
>> On Mon, Feb 22, 2010 at 4:24 PM, David Vrabel <david.vrabel@csr.com> wrote:
>>> These patches add support for SDIO cards to the omap_hsmmc driver.
>>> Power management changes to prevent SDIO cards from being turned off
>>> and losing all state, and card interrupts.
>>>
>>> I've been unable to test these exact patches as I only have an N900 for
>>> testing and the N900 support in mainline is incomplete.
>>
>> Can't you get the source code with 'apt-get source' in Maemo SDK? It's
>> a tarball but at least it's something.
>
> I have SDIO cards tested and working on the N900 with the Fremantle
> kernel but that's a modified 2.6.28 kernel.  These patches are for
> mainline and there are differences between mainline and the fremantle
> kernel that means they need different patches.

Ah, got it. I was wondering how exactly did you test the patches.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
                   ` (2 preceding siblings ...)
  2010-02-22 14:55 ` [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) Felipe Contreras
@ 2010-02-24 10:07 ` Mike Rapoport
  2010-08-27 19:22 ` Chris Ball
  4 siblings, 0 replies; 29+ messages in thread
From: Mike Rapoport @ 2010-02-24 10:07 UTC (permalink / raw)
  To: David Vrabel; +Cc: linux-mmc, linux-omap, madhu.cr, Mike Rapoport

Hi David,

David Vrabel wrote:
> These patches add support for SDIO cards to the omap_hsmmc driver.
> Power management changes to prevent SDIO cards from being turned off
> and losing all state, and card interrupts.

I've tested your patches with libertas_sdio and after several small
additions I've made it work.

  drivers/mmc/host/omap_hsmmc.c |   19 +++++++++++++------
  1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 53fa85d..6ed71b7 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -82,6 +82,7 @@
  #define BWR_ENABLE		(1 << 4)
  #define BRR_ENABLE		(1 << 5)
  #define CTPL			(1 << 11)
+#define CLKEXTFREE		(1 << 16)
  #define INIT_STREAM		(1 << 1)
  #define DP_SELECT		(1 << 21)
  #define DDIR			(1 << 4)
@@ -189,6 +190,7 @@ struct omap_hsmmc_host {
  	int			protect_card;
  	int			reqs_blocked;
  	int			use_reg;
+	int			sdio_int;

  	struct	omap_mmc_platform_data	*pdata;
  };
@@ -763,16 +765,19 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
  	struct mmc_data *data)
  {
  	int cmdreg = 0, resptype = 0, cmdtype = 0;
+	int int_en_mask = INT_EN_MASK;

  	dev_dbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n",
  		mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
  	host->cmd = cmd;

  	if (host->use_dma)
-		OMAP_HSMMC_WRITE(host->base, IE,
-				 INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE));
-	else
-		OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+		int_en_mask &= ~(BRR_ENABLE | BWR_ENABLE);
+
+	if (host->sdio_int)
+		int_en_mask |= CIRQ;
+
+	OMAP_HSMMC_WRITE(host->base, IE, int_en_mask);

  	host->response_busy = 0;
  	if (cmd->flags & MMC_RSP_PRESENT) {
@@ -1619,10 +1624,12 @@ static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
  	if (enable) {
  		clk_enable(host->fclk);
  		ie |= CIRQ_ENABLE;
-		con |= CTPL;
+		con |= CTPL | CLKEXTFREE;
+		host->sdio_int = 1;
  	} else {
  		ie &= ~CIRQ_ENABLE;
-		con &= ~CTPL;
+		con &= ~(CTPL | CLKEXTFREE);
+		host->sdio_int = 0;
  	}
  	OMAP_HSMMC_WRITE(host->base, CON, con);
  	OMAP_HSMMC_WRITE(host->base, IE, ie);
-- 
1.6.4.4


> I've been unable to test these exact patches as I only have an N900 for 
> testing and the N900 support in mainline is incomplete.
> 
> Changes since v1:
> - (hopefully) get all cards working again by removing a second call to
>   read MMCi_STAT in the interrupt handler.
> - flush posted writes after enabling/disabling SDIO interrupts.
> - tweak the FIXME commit on disabling FCLK to better match what really
>   going on (at least I think so anyway).
> 
> David Vrabel (2):
>   mmc: omap_hsmmc: don't turn SDIO cards off when idle
>   mmc: omap_hsmmc: enable SDIO card interrupts
> 
>  drivers/mmc/host/omap_hsmmc.c |  114 ++++++++++++++++++++++++++++-------------
>  1 files changed, 79 insertions(+), 35 deletions(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Sincerely yours,
Mike.


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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
                   ` (3 preceding siblings ...)
  2010-02-24 10:07 ` Mike Rapoport
@ 2010-08-27 19:22 ` Chris Ball
  2010-08-31  8:59   ` David Vrabel
  4 siblings, 1 reply; 29+ messages in thread
From: Chris Ball @ 2010-08-27 19:22 UTC (permalink / raw)
  To: David Vrabel; +Cc: linux-mmc, linux-omap, madhu.cr, Mike Rapoport

Hi David,

On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
> These patches add support for SDIO cards to the omap_hsmmc driver.
> Power management changes to prevent SDIO cards from being turned off
> and losing all state, and card interrupts.
> 
> I've been unable to test these exact patches as I only have an N900 for 
> testing and the N900 support in mainline is incomplete.
> 
> Changes since v1:
> - (hopefully) get all cards working again by removing a second call to
>   read MMCi_STAT in the interrupt handler.
> - flush posted writes after enabling/disabling SDIO interrupts.
> - tweak the FIXME commit on disabling FCLK to better match what really
>   going on (at least I think so anyway).
> 
> David Vrabel (2):
>   mmc: omap_hsmmc: don't turn SDIO cards off when idle
>   mmc: omap_hsmmc: enable SDIO card interrupts

Looks like this patchset wasn't merged.  Mike Rapoport replied with a 
fix for libertas.  Would you like to resubmit it?

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-08-27 19:22 ` Chris Ball
@ 2010-08-31  8:59   ` David Vrabel
  2010-09-01 18:07     ` mike
  2010-09-02  6:02     ` Mike Rapoport
  0 siblings, 2 replies; 29+ messages in thread
From: David Vrabel @ 2010-08-31  8:59 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linux-omap, madhu.cr, Mike Rapoport

On 27/08/2010 20:22, Chris Ball wrote:
> Hi David,
> 
> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
>> These patches add support for SDIO cards to the omap_hsmmc driver.
>> Power management changes to prevent SDIO cards from being turned off
>> and losing all state, and card interrupts.
>>
>> I've been unable to test these exact patches as I only have an N900 for 
>> testing and the N900 support in mainline is incomplete.
>>
>> Changes since v1:
>> - (hopefully) get all cards working again by removing a second call to
>>   read MMCi_STAT in the interrupt handler.
>> - flush posted writes after enabling/disabling SDIO interrupts.
>> - tweak the FIXME commit on disabling FCLK to better match what really
>>   going on (at least I think so anyway).
>>
>> David Vrabel (2):
>>   mmc: omap_hsmmc: don't turn SDIO cards off when idle
>>   mmc: omap_hsmmc: enable SDIO card interrupts
> 
> Looks like this patchset wasn't merged.  Mike Rapoport replied with a 
> fix for libertas.  Would you like to resubmit it?

I thought Madhu had picked this up and was going to submit it.

Regardless of whether that is the case, I think it needs to be submitted
by someone who can run mainline kernels (I can't) and ideally someone
who can test it with SDIO cards.

David

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-08-31  8:59   ` David Vrabel
@ 2010-09-01 18:07     ` mike
  2010-09-02  6:02     ` Mike Rapoport
  1 sibling, 0 replies; 29+ messages in thread
From: mike @ 2010-09-01 18:07 UTC (permalink / raw)
  To: David Vrabel; +Cc: Chris Ball, linux-mmc, linux-omap, madhu.cr

On Tue, Aug 31, 2010 at 09:59:44AM +0100, David Vrabel wrote:
> On 27/08/2010 20:22, Chris Ball wrote:
> > Hi David,
> > 
> > On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
> >> These patches add support for SDIO cards to the omap_hsmmc driver.
> >> Power management changes to prevent SDIO cards from being turned off
> >> and losing all state, and card interrupts.
> >>
> >> I've been unable to test these exact patches as I only have an N900 for 
> >> testing and the N900 support in mainline is incomplete.
> >>
> >> Changes since v1:
> >> - (hopefully) get all cards working again by removing a second call to
> >>   read MMCi_STAT in the interrupt handler.
> >> - flush posted writes after enabling/disabling SDIO interrupts.
> >> - tweak the FIXME commit on disabling FCLK to better match what really
> >>   going on (at least I think so anyway).
> >>
> >> David Vrabel (2):
> >>   mmc: omap_hsmmc: don't turn SDIO cards off when idle
> >>   mmc: omap_hsmmc: enable SDIO card interrupts
> > 
> > Looks like this patchset wasn't merged.  Mike Rapoport replied with a 
> > fix for libertas.  Would you like to resubmit it?
> 
> I thought Madhu had picked this up and was going to submit it.
> 
> Regardless of whether that is the case, I think it needs to be submitted
> by someone who can run mainline kernels (I can't) and ideally someone
> who can test it with SDIO cards.

I'll try to update it to the recent kernel in the next few days.

> David

--
Sincerely yours,
Mike

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-08-31  8:59   ` David Vrabel
  2010-09-01 18:07     ` mike
@ 2010-09-02  6:02     ` Mike Rapoport
  2010-10-04 16:32       ` Steve Sakoman
  1 sibling, 1 reply; 29+ messages in thread
From: Mike Rapoport @ 2010-09-02  6:02 UTC (permalink / raw)
  To: David Vrabel; +Cc: Chris Ball, linux-mmc, linux-omap, madhu.cr, Mike Rapoport

David Vrabel wrote:
> On 27/08/2010 20:22, Chris Ball wrote:
>> Hi David,
>>
>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
>>> These patches add support for SDIO cards to the omap_hsmmc driver.
>>> Power management changes to prevent SDIO cards from being turned off
>>> and losing all state, and card interrupts.
>>>
>>> I've been unable to test these exact patches as I only have an N900 for 
>>> testing and the N900 support in mainline is incomplete.
>>>
>>> Changes since v1:
>>> - (hopefully) get all cards working again by removing a second call to
>>>   read MMCi_STAT in the interrupt handler.
>>> - flush posted writes after enabling/disabling SDIO interrupts.
>>> - tweak the FIXME commit on disabling FCLK to better match what really
>>>   going on (at least I think so anyway).
>>>
>>> David Vrabel (2):
>>>   mmc: omap_hsmmc: don't turn SDIO cards off when idle
>>>   mmc: omap_hsmmc: enable SDIO card interrupts
>> Looks like this patchset wasn't merged.  Mike Rapoport replied with a 
>> fix for libertas.  Would you like to resubmit it?
> 
> I thought Madhu had picked this up and was going to submit it.
> 
> Regardless of whether that is the case, I think it needs to be submitted
> by someone who can run mainline kernels (I can't) and ideally someone
> who can test it with SDIO cards.

I'll try to update the patches in the next few days.

> David


-- 
Sincerely yours,
Mike.

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-09-02  6:02     ` Mike Rapoport
@ 2010-10-04 16:32       ` Steve Sakoman
  2010-10-04 16:45         ` Madhusudhan
  0 siblings, 1 reply; 29+ messages in thread
From: Steve Sakoman @ 2010-10-04 16:32 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: David Vrabel, Chris Ball, linux-mmc, linux-omap, madhu.cr

On Wed, Sep 1, 2010 at 11:02 PM, Mike Rapoport <mike@compulab.co.il> wrote:
> David Vrabel wrote:
>>
>> On 27/08/2010 20:22, Chris Ball wrote:
>>>
>>> Hi David,
>>>
>>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
>>>>
>>>> These patches add support for SDIO cards to the omap_hsmmc driver.
>>>> Power management changes to prevent SDIO cards from being turned off
>>>> and losing all state, and card interrupts.
>>>>
>>>> I've been unable to test these exact patches as I only have an N900 for
>>>> testing and the N900 support in mainline is incomplete.
>>>>
>>>> Changes since v1:
>>>> - (hopefully) get all cards working again by removing a second call to
>>>>  read MMCi_STAT in the interrupt handler.
>>>> - flush posted writes after enabling/disabling SDIO interrupts.
>>>> - tweak the FIXME commit on disabling FCLK to better match what really
>>>>  going on (at least I think so anyway).
>>>>
>>>> David Vrabel (2):
>>>>  mmc: omap_hsmmc: don't turn SDIO cards off when idle
>>>>  mmc: omap_hsmmc: enable SDIO card interrupts
>>>
>>> Looks like this patchset wasn't merged.  Mike Rapoport replied with a fix
>>> for libertas.  Would you like to resubmit it?
>>
>> I thought Madhu had picked this up and was going to submit it.
>>
>> Regardless of whether that is the case, I think it needs to be submitted
>> by someone who can run mainline kernels (I can't) and ideally someone
>> who can test it with SDIO cards.
>
> I'll try to update the patches in the next few days.

Any update on the status of these patches?  I'm happy to help test!

Steve

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

* RE: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-04 16:32       ` Steve Sakoman
@ 2010-10-04 16:45         ` Madhusudhan
  2010-10-04 16:57           ` Steve Sakoman
  0 siblings, 1 reply; 29+ messages in thread
From: Madhusudhan @ 2010-10-04 16:45 UTC (permalink / raw)
  To: 'Steve Sakoman', 'Mike Rapoport'
  Cc: 'David Vrabel', 'Chris Ball', linux-mmc,
	linux-omap



> -----Original Message-----
> From: Steve Sakoman [mailto:sakoman@gmail.com]
> Sent: Monday, October 04, 2010 11:32 AM
> To: Mike Rapoport
> Cc: David Vrabel; Chris Ball; linux-mmc@vger.kernel.org; linux-
> omap@vger.kernel.org; madhu.cr@ti.com
> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
> 
> On Wed, Sep 1, 2010 at 11:02 PM, Mike Rapoport <mike@compulab.co.il>
> wrote:
> > David Vrabel wrote:
> >>
> >> On 27/08/2010 20:22, Chris Ball wrote:
> >>>
> >>> Hi David,
> >>>
> >>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
> >>>>
> >>>> These patches add support for SDIO cards to the omap_hsmmc driver.
> >>>> Power management changes to prevent SDIO cards from being turned off
> >>>> and losing all state, and card interrupts.
> >>>>
> >>>> I've been unable to test these exact patches as I only have an N900
> for
> >>>> testing and the N900 support in mainline is incomplete.
> >>>>
> >>>> Changes since v1:
> >>>> - (hopefully) get all cards working again by removing a second call
> to
> >>>>  read MMCi_STAT in the interrupt handler.
> >>>> - flush posted writes after enabling/disabling SDIO interrupts.
> >>>> - tweak the FIXME commit on disabling FCLK to better match what
> really
> >>>>  going on (at least I think so anyway).
> >>>>
> >>>> David Vrabel (2):
> >>>>  mmc: omap_hsmmc: don't turn SDIO cards off when idle
> >>>>  mmc: omap_hsmmc: enable SDIO card interrupts
> >>>
> >>> Looks like this patchset wasn't merged.  Mike Rapoport replied with a
> fix
> >>> for libertas.  Would you like to resubmit it?
> >>
> >> I thought Madhu had picked this up and was going to submit it.
> >>
> >> Regardless of whether that is the case, I think it needs to be
> submitted
> >> by someone who can run mainline kernels (I can't) and ideally someone
> >> who can test it with SDIO cards.
> >
> > I'll try to update the patches in the next few days.
> 
> Any update on the status of these patches?  I'm happy to help test!
> 
Steve,

I have not been able to test SDIO card interrupts. If you could help test
that it's great.

Regards,
Madhu

> Steve

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

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-04 16:45         ` Madhusudhan
@ 2010-10-04 16:57           ` Steve Sakoman
  2010-10-04 17:33             ` Madhusudhan
  0 siblings, 1 reply; 29+ messages in thread
From: Steve Sakoman @ 2010-10-04 16:57 UTC (permalink / raw)
  To: Madhusudhan
  Cc: Mike Rapoport, David Vrabel, Chris Ball, linux-mmc, linux-omap

On Mon, Oct 4, 2010 at 9:45 AM, Madhusudhan <madhu.cr@ti.com> wrote:
>
>
>> -----Original Message-----
>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>> Sent: Monday, October 04, 2010 11:32 AM
>> To: Mike Rapoport
>> Cc: David Vrabel; Chris Ball; linux-mmc@vger.kernel.org; linux-
>> omap@vger.kernel.org; madhu.cr@ti.com
>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>
>> On Wed, Sep 1, 2010 at 11:02 PM, Mike Rapoport <mike@compulab.co.il>
>> wrote:
>> > David Vrabel wrote:
>> >>
>> >> On 27/08/2010 20:22, Chris Ball wrote:
>> >>>
>> >>> Hi David,
>> >>>
>> >>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
>> >>>>
>> >>>> These patches add support for SDIO cards to the omap_hsmmc driver.
>> >>>> Power management changes to prevent SDIO cards from being turned off
>> >>>> and losing all state, and card interrupts.
>> >>>>
>> >>>> I've been unable to test these exact patches as I only have an N900
>> for
>> >>>> testing and the N900 support in mainline is incomplete.
>> >>>>
>> >>>> Changes since v1:
>> >>>> - (hopefully) get all cards working again by removing a second call
>> to
>> >>>>  read MMCi_STAT in the interrupt handler.
>> >>>> - flush posted writes after enabling/disabling SDIO interrupts.
>> >>>> - tweak the FIXME commit on disabling FCLK to better match what
>> really
>> >>>>  going on (at least I think so anyway).
>> >>>>
>> >>>> David Vrabel (2):
>> >>>>  mmc: omap_hsmmc: don't turn SDIO cards off when idle
>> >>>>  mmc: omap_hsmmc: enable SDIO card interrupts
>> >>>
>> >>> Looks like this patchset wasn't merged.  Mike Rapoport replied with a
>> fix
>> >>> for libertas.  Would you like to resubmit it?
>> >>
>> >> I thought Madhu had picked this up and was going to submit it.
>> >>
>> >> Regardless of whether that is the case, I think it needs to be
>> submitted
>> >> by someone who can run mainline kernels (I can't) and ideally someone
>> >> who can test it with SDIO cards.
>> >
>> > I'll try to update the patches in the next few days.
>>
>> Any update on the status of these patches?  I'm happy to help test!
>>
> Steve,
>
> I have not been able to test SDIO card interrupts. If you could help test
> that it's great.

Where can I grab the most recent patches?  The original set don't apply cleanly.

Steve

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

* RE: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-04 16:57           ` Steve Sakoman
@ 2010-10-04 17:33             ` Madhusudhan
  2010-10-04 18:09               ` Steve Sakoman
  0 siblings, 1 reply; 29+ messages in thread
From: Madhusudhan @ 2010-10-04 17:33 UTC (permalink / raw)
  To: 'Steve Sakoman'
  Cc: 'Mike Rapoport', 'David Vrabel',
	'Chris Ball', linux-mmc, linux-omap



> -----Original Message-----
> From: Steve Sakoman [mailto:sakoman@gmail.com]
> Sent: Monday, October 04, 2010 11:57 AM
> To: Madhusudhan
> Cc: Mike Rapoport; David Vrabel; Chris Ball; linux-mmc@vger.kernel.org;
> linux-omap@vger.kernel.org
> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
> 
> On Mon, Oct 4, 2010 at 9:45 AM, Madhusudhan <madhu.cr@ti.com> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Steve Sakoman [mailto:sakoman@gmail.com]
> >> Sent: Monday, October 04, 2010 11:32 AM
> >> To: Mike Rapoport
> >> Cc: David Vrabel; Chris Ball; linux-mmc@vger.kernel.org; linux-
> >> omap@vger.kernel.org; madhu.cr@ti.com
> >> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
> >>
> >> On Wed, Sep 1, 2010 at 11:02 PM, Mike Rapoport <mike@compulab.co.il>
> >> wrote:
> >> > David Vrabel wrote:
> >> >>
> >> >> On 27/08/2010 20:22, Chris Ball wrote:
> >> >>>
> >> >>> Hi David,
> >> >>>
> >> >>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
> >> >>>>
> >> >>>> These patches add support for SDIO cards to the omap_hsmmc driver.
> >> >>>> Power management changes to prevent SDIO cards from being turned
> off
> >> >>>> and losing all state, and card interrupts.
> >> >>>>
> >> >>>> I've been unable to test these exact patches as I only have an
> N900
> >> for
> >> >>>> testing and the N900 support in mainline is incomplete.
> >> >>>>
> >> >>>> Changes since v1:
> >> >>>> - (hopefully) get all cards working again by removing a second
> call
> >> to
> >> >>>>  read MMCi_STAT in the interrupt handler.
> >> >>>> - flush posted writes after enabling/disabling SDIO interrupts.
> >> >>>> - tweak the FIXME commit on disabling FCLK to better match what
> >> really
> >> >>>>  going on (at least I think so anyway).
> >> >>>>
> >> >>>> David Vrabel (2):
> >> >>>>  mmc: omap_hsmmc: don't turn SDIO cards off when idle
> >> >>>>  mmc: omap_hsmmc: enable SDIO card interrupts
> >> >>>
> >> >>> Looks like this patchset wasn't merged.  Mike Rapoport replied with
> a
> >> fix
> >> >>> for libertas.  Would you like to resubmit it?
> >> >>
> >> >> I thought Madhu had picked this up and was going to submit it.
> >> >>
> >> >> Regardless of whether that is the case, I think it needs to be
> >> submitted
> >> >> by someone who can run mainline kernels (I can't) and ideally
> someone
> >> >> who can test it with SDIO cards.
> >> >
> >> > I'll try to update the patches in the next few days.
> >>
> >> Any update on the status of these patches?  I'm happy to help test!
> >>
> > Steve,
> >
> > I have not been able to test SDIO card interrupts. If you could help
> test
> > that it's great.
> 
> Where can I grab the most recent patches?  The original set don't apply
> cleanly.
> 

Yes. They may not apply. I can rebase them and send it to you for testing.
Are you using the two patches posted by David Vrabel?

Regards,
Madhu

> Steve


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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-04 17:33             ` Madhusudhan
@ 2010-10-04 18:09               ` Steve Sakoman
  2010-10-06  6:17                 ` Mike Rapoport
  0 siblings, 1 reply; 29+ messages in thread
From: Steve Sakoman @ 2010-10-04 18:09 UTC (permalink / raw)
  To: Madhusudhan
  Cc: Mike Rapoport, David Vrabel, Chris Ball, linux-mmc, linux-omap

On Mon, Oct 4, 2010 at 10:33 AM, Madhusudhan <madhu.cr@ti.com> wrote:
>
>
>> -----Original Message-----
>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>> Sent: Monday, October 04, 2010 11:57 AM
>> To: Madhusudhan
>> Cc: Mike Rapoport; David Vrabel; Chris Ball; linux-mmc@vger.kernel.org;
>> linux-omap@vger.kernel.org
>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>
>> On Mon, Oct 4, 2010 at 9:45 AM, Madhusudhan <madhu.cr@ti.com> wrote:
>> >
>> >
>> >> -----Original Message-----
>> >> From: Steve Sakoman [mailto:sakoman@gmail.com]
>> >> Sent: Monday, October 04, 2010 11:32 AM
>> >> To: Mike Rapoport
>> >> Cc: David Vrabel; Chris Ball; linux-mmc@vger.kernel.org; linux-
>> >> omap@vger.kernel.org; madhu.cr@ti.com
>> >> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>> >>
>> >> On Wed, Sep 1, 2010 at 11:02 PM, Mike Rapoport <mike@compulab.co.il>
>> >> wrote:
>> >> > David Vrabel wrote:
>> >> >>
>> >> >> On 27/08/2010 20:22, Chris Ball wrote:
>> >> >>>
>> >> >>> Hi David,
>> >> >>>
>> >> >>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
>> >> >>>>
>> >> >>>> These patches add support for SDIO cards to the omap_hsmmc driver.
>> >> >>>> Power management changes to prevent SDIO cards from being turned
>> off
>> >> >>>> and losing all state, and card interrupts.
>> >> >>>>
>> >> >>>> I've been unable to test these exact patches as I only have an
>> N900
>> >> for
>> >> >>>> testing and the N900 support in mainline is incomplete.
>> >> >>>>
>> >> >>>> Changes since v1:
>> >> >>>> - (hopefully) get all cards working again by removing a second
>> call
>> >> to
>> >> >>>>  read MMCi_STAT in the interrupt handler.
>> >> >>>> - flush posted writes after enabling/disabling SDIO interrupts.
>> >> >>>> - tweak the FIXME commit on disabling FCLK to better match what
>> >> really
>> >> >>>>  going on (at least I think so anyway).
>> >> >>>>
>> >> >>>> David Vrabel (2):
>> >> >>>>  mmc: omap_hsmmc: don't turn SDIO cards off when idle
>> >> >>>>  mmc: omap_hsmmc: enable SDIO card interrupts
>> >> >>>
>> >> >>> Looks like this patchset wasn't merged.  Mike Rapoport replied with
>> a
>> >> fix
>> >> >>> for libertas.  Would you like to resubmit it?
>> >> >>
>> >> >> I thought Madhu had picked this up and was going to submit it.
>> >> >>
>> >> >> Regardless of whether that is the case, I think it needs to be
>> >> submitted
>> >> >> by someone who can run mainline kernels (I can't) and ideally
>> someone
>> >> >> who can test it with SDIO cards.
>> >> >
>> >> > I'll try to update the patches in the next few days.
>> >>
>> >> Any update on the status of these patches?  I'm happy to help test!
>> >>
>> > Steve,
>> >
>> > I have not been able to test SDIO card interrupts. If you could help
>> test
>> > that it's great.
>>
>> Where can I grab the most recent patches?  The original set don't apply
>> cleanly.
>>
>
> Yes. They may not apply. I can rebase them and send it to you for testing.
> Are you using the two patches posted by David Vrabel?

Yes, I've been using the original patches on 2.6.33 and 2.6.34.  The
SDIO interrupt patch doesn't apply on 2.6.35 or 36.

If you send a revised patch for either I would be happy to test as
soon as I get it.

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-04 18:09               ` Steve Sakoman
@ 2010-10-06  6:17                 ` Mike Rapoport
  2010-10-06 12:55                   ` Steve Sakoman
  0 siblings, 1 reply; 29+ messages in thread
From: Mike Rapoport @ 2010-10-06  6:17 UTC (permalink / raw)
  To: Steve Sakoman
  Cc: Madhusudhan, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter, Mike Rapoport

Steve Sakoman wrote:
> On Mon, Oct 4, 2010 at 10:33 AM, Madhusudhan <madhu.cr@ti.com> wrote:
>>
>>> -----Original Message-----
>>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>>> Sent: Monday, October 04, 2010 11:57 AM
>>> To: Madhusudhan
>>> Cc: Mike Rapoport; David Vrabel; Chris Ball; linux-mmc@vger.kernel.org;
>>> linux-omap@vger.kernel.org
>>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>>
>>> On Mon, Oct 4, 2010 at 9:45 AM, Madhusudhan <madhu.cr@ti.com> wrote:
>>>>
>>>>> -----Original Message-----
>>>>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>>>>> Sent: Monday, October 04, 2010 11:32 AM
>>>>> To: Mike Rapoport
>>>>> Cc: David Vrabel; Chris Ball; linux-mmc@vger.kernel.org; linux-
>>>>> omap@vger.kernel.org; madhu.cr@ti.com
>>>>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>>>>
>>>>> On Wed, Sep 1, 2010 at 11:02 PM, Mike Rapoport <mike@compulab.co.il>
>>>>> wrote:
>>>>>> David Vrabel wrote:
>>>>>>> On 27/08/2010 20:22, Chris Ball wrote:
>>>>>>>> Hi David,
>>>>>>>>
>>>>>>>> On Mon, Feb 22, 2010 at 02:24:17PM +0000, David Vrabel wrote:
>>>>>>>>> These patches add support for SDIO cards to the omap_hsmmc driver.
>>>>>>>>> Power management changes to prevent SDIO cards from being turned
>>> off
>>>>>>>>> and losing all state, and card interrupts.
>>>>>>>>>
>>>>>>>>> I've been unable to test these exact patches as I only have an
>>> N900
>>>>> for
>>>>>>>>> testing and the N900 support in mainline is incomplete.
>>>>>>>>>
>>>>>>>>> Changes since v1:
>>>>>>>>> - (hopefully) get all cards working again by removing a second
>>> call
>>>>> to
>>>>>>>>>  read MMCi_STAT in the interrupt handler.
>>>>>>>>> - flush posted writes after enabling/disabling SDIO interrupts.
>>>>>>>>> - tweak the FIXME commit on disabling FCLK to better match what
>>>>> really
>>>>>>>>>  going on (at least I think so anyway).
>>>>>>>>>
>>>>>>>>> David Vrabel (2):
>>>>>>>>>  mmc: omap_hsmmc: don't turn SDIO cards off when idle
>>>>>>>>>  mmc: omap_hsmmc: enable SDIO card interrupts
>>>>>>>> Looks like this patchset wasn't merged.  Mike Rapoport replied with
>>> a
>>>>> fix
>>>>>>>> for libertas.  Would you like to resubmit it?
>>>>>>> I thought Madhu had picked this up and was going to submit it.
>>>>>>>
>>>>>>> Regardless of whether that is the case, I think it needs to be
>>>>> submitted
>>>>>>> by someone who can run mainline kernels (I can't) and ideally
>>> someone
>>>>>>> who can test it with SDIO cards.
>>>>>> I'll try to update the patches in the next few days.
>>>>> Any update on the status of these patches?  I'm happy to help test!
>>>>>
>>>> Steve,
>>>>
>>>> I have not been able to test SDIO card interrupts. If you could help
>>> test
>>>> that it's great.
>>> Where can I grab the most recent patches?  The original set don't apply
>>> cleanly.
>>>
>> Yes. They may not apply. I can rebase them and send it to you for testing.
>> Are you using the two patches posted by David Vrabel?
> 
> Yes, I've been using the original patches on 2.6.33 and 2.6.34.  The
> SDIO interrupt patch doesn't apply on 2.6.35 or 36.
> 
> If you send a revised patch for either I would be happy to test as
> soon as I get it.

I've tried to update the patches on top of 2.6.36-rc3 and I've got stuck.
The changes Adrian has made to the interrupt synchronization  affect the way the
SDIO irq should be implemented and I haven't found a way to resolve it :-(

> Steve


-- 
Sincerely yours,
Mike.


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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06  6:17                 ` Mike Rapoport
@ 2010-10-06 12:55                   ` Steve Sakoman
  2010-10-06 13:45                     ` Mike Rapoport
  0 siblings, 1 reply; 29+ messages in thread
From: Steve Sakoman @ 2010-10-06 12:55 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Madhusudhan, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter

On Tue, Oct 5, 2010 at 11:17 PM, Mike Rapoport <mike@compulab.co.il> wrote:

> I've tried to update the patches on top of 2.6.36-rc3 and I've got stuck.
> The changes Adrian has made to the interrupt synchronization  affect the way
> the
> SDIO irq should be implemented and I haven't found a way to resolve it :-(

I tried my hand at making the patch apply on 2.6.35:

http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff;h=51b802d73191c306618cddefbd63379c839589f5

It seems to work, but I'm pretty sure I must have messed something up
because I get error messages every once in a while:

libertas: tx watch dog timeout

I don't recall seeing these with the original version of the patch :-(

Suggestions as to where I went wrong are welcome!

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06 12:55                   ` Steve Sakoman
@ 2010-10-06 13:45                     ` Mike Rapoport
  2010-10-06 15:22                       ` Steve Sakoman
  0 siblings, 1 reply; 29+ messages in thread
From: Mike Rapoport @ 2010-10-06 13:45 UTC (permalink / raw)
  To: Steve Sakoman
  Cc: Madhusudhan, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter, Mike Rapoport

Hi Steve,
Steve Sakoman wrote:
> On Tue, Oct 5, 2010 at 11:17 PM, Mike Rapoport <mike@compulab.co.il> wrote:
> 
>> I've tried to update the patches on top of 2.6.36-rc3 and I've got stuck.
>> The changes Adrian has made to the interrupt synchronization  affect the way
>> the
>> SDIO irq should be implemented and I haven't found a way to resolve it :-(
> 
> I tried my hand at making the patch apply on 2.6.35:
> 
> http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff;h=51b802d73191c306618cddefbd63379c839589f5

This one fails to build:

   CC      drivers/mmc/host/omap_hsmmc.o
drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_start_command': 

drivers/mmc/host/omap_hsmmc.c:791: warning: unused variable 'int_en_mask' 

drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_do_irq': 

drivers/mmc/host/omap_hsmmc.c:1023: error: label 'out' used but not defined 

drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_irq': 

drivers/mmc/host/omap_hsmmc.c:1101: warning: label 'out' defined but not used 

drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend': 

drivers/mmc/host/omap_hsmmc.c:2346: warning: unused variable 'state' 

make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1

Moving the 'out' label where I believe it should live I get:
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas: command 0x0003 timed out
libertas: Timeout submitting command 0x0003
libertas: PREP_CMD: command 0x0003 failed: -110
libertas_sdio: probe of mmc1:0001:1 failed with error -110

> 
> It seems to work, but I'm pretty sure I must have messed something up
> because I get error messages every once in a while:
> 
> libertas: tx watch dog timeout
> 
> I don't recall seeing these with the original version of the patch :-(
> 
> Suggestions as to where I went wrong are welcome!

I've "applied" the patch almost the same way you did and I was not able to get 
any further than the point above (command 0x0003 timed out). As far as I 
understand, what we have now is that omap_hsmmc_request_done() calls 
omap_hsmmc_disable_irq() and the interrupts that come from the 8686 _between_ 
requests are simply missed. Whatever I've tried to keep the SDIO interrupts on 
didn't help... :(

> Steve


-- 
Sincerely yours,
Mike.

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06 13:45                     ` Mike Rapoport
@ 2010-10-06 15:22                       ` Steve Sakoman
  2010-10-06 18:28                         ` Madhusudhan Chikkature
  0 siblings, 1 reply; 29+ messages in thread
From: Steve Sakoman @ 2010-10-06 15:22 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Madhusudhan, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter

On Wed, Oct 6, 2010 at 6:45 AM, Mike Rapoport <mike@compulab.co.il> wrote:
> Hi Steve,
> Steve Sakoman wrote:
>>
>> On Tue, Oct 5, 2010 at 11:17 PM, Mike Rapoport <mike@compulab.co.il>
>> wrote:
>>
>>> I've tried to update the patches on top of 2.6.36-rc3 and I've got stuck.
>>> The changes Adrian has made to the interrupt synchronization  affect the
>>> way
>>> the
>>> SDIO irq should be implemented and I haven't found a way to resolve it
>>> :-(
>>
>> I tried my hand at making the patch apply on 2.6.35:
>>
>>
>> http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff;h=51b802d73191c306618cddefbd63379c839589f5
>
> This one fails to build:
>
>  CC      drivers/mmc/host/omap_hsmmc.o
> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_start_command':
> drivers/mmc/host/omap_hsmmc.c:791: warning: unused variable 'int_en_mask'
> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_do_irq':
> drivers/mmc/host/omap_hsmmc.c:1023: error: label 'out' used but not defined
> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_irq':
> drivers/mmc/host/omap_hsmmc.c:1101: warning: label 'out' defined but not
> used
> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
> drivers/mmc/host/omap_hsmmc.c:2346: warning: unused variable 'state'
> make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1
>
> Moving the 'out' label where I believe it should live I get:
> libertas_sdio: Libertas SDIO driver
> libertas_sdio: Copyright Pierre Ossman
> libertas: command 0x0003 timed out
> libertas: Timeout submitting command 0x0003
> libertas: PREP_CMD: command 0x0003 failed: -110
> libertas_sdio: probe of mmc1:0001:1 failed with error -110
>
>>
>> It seems to work, but I'm pretty sure I must have messed something up
>> because I get error messages every once in a while:
>>
>> libertas: tx watch dog timeout
>>
>> I don't recall seeing these with the original version of the patch :-(
>>
>> Suggestions as to where I went wrong are welcome!
>
> I've "applied" the patch almost the same way you did and I was not able to
> get any further than the point above (command 0x0003 timed out). As far as I
> understand, what we have now is that omap_hsmmc_request_done() calls
> omap_hsmmc_disable_irq() and the interrupts that come from the 8686
> _between_ requests are simply missed. Whatever I've tried to keep the SDIO
> interrupts on didn't help... :(

You are correct!  The version of the patch in the repo indeed has
'out' in the wrong place and generates a compile error.

Could you post the patch you are using and I will try to reproduce
what you are seeing on my hardware?  Best we all work from exactly the
same patch!

Steve

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06 15:22                       ` Steve Sakoman
@ 2010-10-06 18:28                         ` Madhusudhan Chikkature
  2010-10-06 19:02                           ` David Vrabel
  2010-10-07  7:15                           ` Mike Rapoport
  0 siblings, 2 replies; 29+ messages in thread
From: Madhusudhan Chikkature @ 2010-10-06 18:28 UTC (permalink / raw)
  To: Steve Sakoman
  Cc: Mike Rapoport, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter


<snip>

> You are correct!  The version of the patch in the repo indeed has
> 'out' in the wrong place and generates a compile error.
>
> Could you post the patch you are using and I will try to reproduce
> what you are seeing on my hardware?  Best we all work from exactly the
> same patch!
>
> Steve
>

Yes. I think that check breaking the compilation is not needed. How about the
below version? It just removes that check.

This version should apply fine on the latest kernel. I did a sanity test of
MMC/SD cards on OMAP4 SDP.

Steve or Mike can check if SDIO interrupts are working.

Regards,
Madhu

>From 08b77fd388f19f5df3758a2c59dcdec280f373c8 Mon Sep 17 00:00:00 2001
From: David Vrabel <david.vrabel@csr.com>
Date: Wed, 6 Oct 2010 12:39:18 -0500
Subject: [PATCH 1/2] mmc: omap_hsmmc: enable SDIO card interrupts

Enable the use of SDIO card interrupts.

FCLK must be enabled while SDIO interrupts are enabled or the MMC
module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in
HTCL have been set).  Enabling the MMC module to wake-up would require
configuring the MMC module (and the mmci_dat[1] GPIO when the CORE
power domain is OFF) as wake-up sources in the PRCM.

The writes to STAT and ISE when starting a command are unnecessary and
have been removed.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
---
 drivers/mmc/host/omap_hsmmc.c |   72 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 4693e62..948dd9a 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -66,6 +66,7 @@
 #define SDVS_MASK		0x00000E00
 #define SDVSCLR			0xFFFFF1FF
 #define SDVSDET			0x00000400
+#define ENAWAKEUP		(1 << 2)
 #define AUTOIDLE		0x1
 #define SDBP			(1 << 8)
 #define DTO			0xe
@@ -76,9 +77,12 @@
 #define CLKD_SHIFT		6
 #define DTO_MASK		0x000F0000
 #define DTO_SHIFT		16
+#define CIRQ_ENABLE		(1 << 8)
 #define INT_EN_MASK		0x307F0033
 #define BWR_ENABLE		(1 << 4)
 #define BRR_ENABLE		(1 << 5)
+#define CTPL			(1 << 11)
+#define CLKEXTFREE		(1 << 16)
 #define DTO_ENABLE		(1 << 20)
 #define INIT_STREAM		(1 << 1)
 #define DP_SELECT		(1 << 21)
@@ -87,10 +91,12 @@
 #define MSBS			(1 << 5)
 #define BCE			(1 << 1)
 #define FOUR_BIT		(1 << 1)
+#define IWE			(1 << 24)
 #define DW8			(1 << 5)
 #define CC			0x1
 #define TC			0x02
 #define OD			0x1
+#define CIRQ			(1 << 8)
 #define ERR			(1 << 15)
 #define CMD_TIMEOUT		(1 << 16)
 #define DATA_TIMEOUT		(1 << 20)
@@ -184,6 +190,7 @@ struct omap_hsmmc_host {
 	int			reqs_blocked;
 	int			use_reg;
 	int			req_in_progress;
+	int			sdio_int;

 	struct	omap_mmc_platform_data	*pdata;
 };
@@ -551,6 +558,9 @@ static void omap_hsmmc_enable_irq(struct omap_hsmmc_host
*host,
 	if (cmd->opcode == MMC_ERASE)
 		irq_mask &= ~DTO_ENABLE;

+	if (host->sdio_int)
+		irq_mask |= CIRQ;
+
 	OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
 	OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
 	OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
@@ -603,7 +613,7 @@ static int omap_hsmmc_context_restore(struct
omap_hsmmc_host *host)
 		;

 	OMAP_HSMMC_WRITE(host->base, SYSCONFIG,
-			OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE);
+		OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE | ENAWAKEUP);

 	if (host->id == OMAP_MMC1_DEVID) {
 		if (host->power_mode != MMC_POWER_OFF &&
@@ -618,7 +628,7 @@ static int omap_hsmmc_context_restore(struct
omap_hsmmc_host *host)
 	}

 	OMAP_HSMMC_WRITE(host->base, HCTL,
-			OMAP_HSMMC_READ(host->base, HCTL) | hctl);
+			OMAP_HSMMC_READ(host->base, HCTL) | hctl | IWE);

 	OMAP_HSMMC_WRITE(host->base, CAPA,
 			OMAP_HSMMC_READ(host->base, CAPA) | capa);
@@ -1019,6 +1029,7 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host
*host, int status)
 {
 	struct mmc_data *data;
 	int end_cmd = 0, end_trans = 0;
+	bool card_irq = false;

 	if (!host->req_in_progress) {
 		do {
@@ -1032,6 +1043,9 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host
*host, int status)
 	data = host->data;
 	dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);

+	if (status & CIRQ)
+		card_irq = true;
+
 	if (status & ERR) {
 #ifdef CONFIG_MMC_DEBUG
 		omap_hsmmc_report_irq(host, status);
@@ -1087,6 +1101,9 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host
*host, int status)
 		omap_hsmmc_cmd_done(host, host->cmd);
 	if ((end_trans || (status & TC)) && host->mrq)
 		omap_hsmmc_xfer_done(host, data);
+	if (card_irq)
+		mmc_signal_sdio_irq(host->mmc);
+
 }

 /*
@@ -1639,6 +1656,47 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc,
struct mmc_card *card)
 		mmc_slot(host).init_card(card);
 }

+static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+	struct omap_hsmmc_host *host = mmc_priv(mmc);
+	u32 ie, con;
+	unsigned long flags;
+
+	spin_lock_irqsave(&host->irq_lock, flags);
+
+	/*
+	 * When interrupts are enabled, CTPL must be set to enable
+	 * DAT1 input buffer (or the card interrupt is always
+	 * asserted) and FCLK must be enabled as wake-up does not
+	 * work.  Take care to disable FCLK after all the register
+	 * accesses as they might not complete if FCLK is off.
+	 *
+	 * FIXME: if the MMC module (and the mmci_dat[1] GPIO when the
+	 * CORE power domain is OFF) are configured as a wake-up
+	 * sources in the PRCM, then FCLK could be switched off.  This
+	 * might add too much latency.
+	 */
+	con = OMAP_HSMMC_READ(host->base, CON);
+	ie = OMAP_HSMMC_READ(host->base, IE);
+	if (enable) {
+		clk_enable(host->fclk);
+		ie |= CIRQ_ENABLE;
+		con |= CTPL | CLKEXTFREE;
+		host->sdio_int = 1;
+	} else {
+		ie &= ~CIRQ_ENABLE;
+		con &= ~(CTPL | CLKEXTFREE);
+		host->sdio_int = 0;
+	}
+	OMAP_HSMMC_WRITE(host->base, CON, con);
+	OMAP_HSMMC_WRITE(host->base, IE, ie);
+	OMAP_HSMMC_READ(host->base, IE); /* flush posted write */
+	if (!enable)
+		clk_disable(host->fclk);
+
+	spin_unlock_irqrestore(&host->irq_lock, flags);
+}
+
 static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
 {
 	u32 hctl, capa, value;
@@ -1653,14 +1711,14 @@ static void omap_hsmmc_conf_bus_power(struct
omap_hsmmc_host *host)
 	}

 	value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
-	OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);
+	OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl | IWE);

 	value = OMAP_HSMMC_READ(host->base, CAPA);
 	OMAP_HSMMC_WRITE(host->base, CAPA, value | capa);

 	/* Set the controller to AUTO IDLE mode */
 	value = OMAP_HSMMC_READ(host->base, SYSCONFIG);
-	OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);
+	OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE | ENAWAKEUP);

 	/* Set SD bus power bit */
 	set_sd_bus_power(host);
@@ -1911,7 +1969,7 @@ static const struct mmc_host_ops omap_hsmmc_ops = {
 	.get_cd = omap_hsmmc_get_cd,
 	.get_ro = omap_hsmmc_get_ro,
 	.init_card = omap_hsmmc_init_card,
-	/* NYET -- enable_sdio_irq */
+	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
 };

 static const struct mmc_host_ops omap_hsmmc_ps_ops = {
@@ -1922,7 +1980,7 @@ static const struct mmc_host_ops omap_hsmmc_ps_ops = {
 	.get_cd = omap_hsmmc_get_cd,
 	.get_ro = omap_hsmmc_get_ro,
 	.init_card = omap_hsmmc_init_card,
-	/* NYET -- enable_sdio_irq */
+	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
 };

 #ifdef CONFIG_DEBUG_FS
@@ -2139,7 +2197,7 @@ static int __init omap_hsmmc_probe(struct platform_device
*pdev)
 	mmc->max_seg_size = mmc->max_req_size;

 	mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-		     MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE;
+		     MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE | MMC_CAP_SDIO_IRQ;

 	mmc->caps |= mmc_slot(host).caps;
 	if (mmc->caps & MMC_CAP_8_BIT_DATA)
-- 
1.7.0.4







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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06 18:28                         ` Madhusudhan Chikkature
@ 2010-10-06 19:02                           ` David Vrabel
  2010-10-06 19:21                             ` Madhusudhan
  2010-10-07  7:15                           ` Mike Rapoport
  1 sibling, 1 reply; 29+ messages in thread
From: David Vrabel @ 2010-10-06 19:02 UTC (permalink / raw)
  To: Madhusudhan Chikkature
  Cc: Steve Sakoman, Mike Rapoport, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter

Madhusudhan Chikkature wrote:
> 
> This version should apply fine on the latest kernel. I did a sanity test of
> MMC/SD cards on OMAP4 SDP.

This /looks/ okay to me, but I can't test it.

> From 08b77fd388f19f5df3758a2c59dcdec280f373c8 Mon Sep 17 00:00:00 2001
> From: David Vrabel <david.vrabel@csr.com>
> Date: Wed, 6 Oct 2010 12:39:18 -0500
> Subject: [PATCH 1/2] mmc: omap_hsmmc: enable SDIO card interrupts
> 
[...]
> 
> The writes to STAT and ISE when starting a command are unnecessary and
> have been removed.

Remove this last paragraph from the description as it isn't applicable
any more.

David
-- 
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom

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

* RE: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06 19:02                           ` David Vrabel
@ 2010-10-06 19:21                             ` Madhusudhan
  0 siblings, 0 replies; 29+ messages in thread
From: Madhusudhan @ 2010-10-06 19:21 UTC (permalink / raw)
  To: 'David Vrabel'
  Cc: 'Steve Sakoman', 'Mike Rapoport',
	'Chris Ball', linux-mmc, linux-omap,
	'Adrian Hunter'



> -----Original Message-----
> From: David Vrabel [mailto:david.vrabel@csr.com]
> Sent: Wednesday, October 06, 2010 2:02 PM
> To: Madhusudhan Chikkature
> Cc: Steve Sakoman; Mike Rapoport; Chris Ball; linux-mmc@vger.kernel.org;
> linux-omap@vger.kernel.org; Adrian Hunter
> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
> 
> Madhusudhan Chikkature wrote:
> >
> > This version should apply fine on the latest kernel. I did a sanity test
> of
> > MMC/SD cards on OMAP4 SDP.
> 
> This /looks/ okay to me, but I can't test it.
> 
> > From 08b77fd388f19f5df3758a2c59dcdec280f373c8 Mon Sep 17 00:00:00 2001
> > From: David Vrabel <david.vrabel@csr.com>
> > Date: Wed, 6 Oct 2010 12:39:18 -0500
> > Subject: [PATCH 1/2] mmc: omap_hsmmc: enable SDIO card interrupts
> >
> [...]
> >
> > The writes to STAT and ISE when starting a command are unnecessary and
> > have been removed.
> 
> Remove this last paragraph from the description as it isn't applicable
> any more.
> 
Sure.

Regards,
Madhu

> David
> --
> David Vrabel, Senior Software Engineer, Drivers
> CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
> Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/
> 
> 
> Member of the CSR plc group of companies. CSR plc registered in England
> and Wales, registered number 4187346, registered office Churchill House,
> Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-06 18:28                         ` Madhusudhan Chikkature
  2010-10-06 19:02                           ` David Vrabel
@ 2010-10-07  7:15                           ` Mike Rapoport
  2010-10-07 13:56                             ` Steve Sakoman
  1 sibling, 1 reply; 29+ messages in thread
From: Mike Rapoport @ 2010-10-07  7:15 UTC (permalink / raw)
  To: Madhusudhan Chikkature
  Cc: Steve Sakoman, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter, Mike Rapoport

Hi Madhu,

Madhusudhan Chikkature wrote:
> <snip>
> 
>> You are correct!  The version of the patch in the repo indeed has
>> 'out' in the wrong place and generates a compile error.
>>
>> Could you post the patch you are using and I will try to reproduce
>> what you are seeing on my hardware?  Best we all work from exactly the
>> same patch!
>>
>> Steve
>>
> 
> Yes. I think that check breaking the compilation is not needed. How about the
> below version? It just removes that check.
> 
> This version should apply fine on the latest kernel. I did a sanity test of
> MMC/SD cards on OMAP4 SDP.
> 
> Steve or Mike can check if SDIO interrupts are working.

With you patch I get the same:

libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas: command 0x0003 timed out
libertas: Timeout submitting command 0x0003
libertas: PREP_CMD: command 0x0003 failed: -110
libertas_sdio: probe of mmc1:0001:1 failed with error -110


The libertas driver is expecting and interrupt from the card that signals 
completion of the firmware initialization. But the SDIO interrupts are disabled 
because every request from host to card has been completed. Moreover, if there 
were SDIO interrupts they would be ignored by the omap_hsmmc_do_irq handler 
because it returns immediately is there is not request in process.

I've tried to move the check for the SDIO interrupt to the very beginning of the 
ISR but to no avail....


> Regards,
> Madhu
> 
> From 08b77fd388f19f5df3758a2c59dcdec280f373c8 Mon Sep 17 00:00:00 2001
> From: David Vrabel <david.vrabel@csr.com>
> Date: Wed, 6 Oct 2010 12:39:18 -0500
> Subject: [PATCH 1/2] mmc: omap_hsmmc: enable SDIO card interrupts
> 
> Enable the use of SDIO card interrupts.
> 
> FCLK must be enabled while SDIO interrupts are enabled or the MMC
> module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in
> HTCL have been set).  Enabling the MMC module to wake-up would require
> configuring the MMC module (and the mmci_dat[1] GPIO when the CORE
> power domain is OFF) as wake-up sources in the PRCM.
> 
> The writes to STAT and ISE when starting a command are unnecessary and
> have been removed.
> 
> Signed-off-by: David Vrabel <david.vrabel@csr.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |   72 +++++++++++++++++++++++++++++++++++++----
>  1 files changed, 65 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 4693e62..948dd9a 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -66,6 +66,7 @@
>  #define SDVS_MASK		0x00000E00
>  #define SDVSCLR			0xFFFFF1FF
>  #define SDVSDET			0x00000400
> +#define ENAWAKEUP		(1 << 2)
>  #define AUTOIDLE		0x1
>  #define SDBP			(1 << 8)
>  #define DTO			0xe
> @@ -76,9 +77,12 @@
>  #define CLKD_SHIFT		6
>  #define DTO_MASK		0x000F0000
>  #define DTO_SHIFT		16
> +#define CIRQ_ENABLE		(1 << 8)
>  #define INT_EN_MASK		0x307F0033
>  #define BWR_ENABLE		(1 << 4)
>  #define BRR_ENABLE		(1 << 5)
> +#define CTPL			(1 << 11)
> +#define CLKEXTFREE		(1 << 16)
>  #define DTO_ENABLE		(1 << 20)
>  #define INIT_STREAM		(1 << 1)
>  #define DP_SELECT		(1 << 21)
> @@ -87,10 +91,12 @@
>  #define MSBS			(1 << 5)
>  #define BCE			(1 << 1)
>  #define FOUR_BIT		(1 << 1)
> +#define IWE			(1 << 24)
>  #define DW8			(1 << 5)
>  #define CC			0x1
>  #define TC			0x02
>  #define OD			0x1
> +#define CIRQ			(1 << 8)
>  #define ERR			(1 << 15)
>  #define CMD_TIMEOUT		(1 << 16)
>  #define DATA_TIMEOUT		(1 << 20)
> @@ -184,6 +190,7 @@ struct omap_hsmmc_host {
>  	int			reqs_blocked;
>  	int			use_reg;
>  	int			req_in_progress;
> +	int			sdio_int;
> 
>  	struct	omap_mmc_platform_data	*pdata;
>  };
> @@ -551,6 +558,9 @@ static void omap_hsmmc_enable_irq(struct omap_hsmmc_host
> *host,
>  	if (cmd->opcode == MMC_ERASE)
>  		irq_mask &= ~DTO_ENABLE;
> 
> +	if (host->sdio_int)
> +		irq_mask |= CIRQ;
> +
>  	OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
>  	OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
>  	OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
> @@ -603,7 +613,7 @@ static int omap_hsmmc_context_restore(struct
> omap_hsmmc_host *host)
>  		;
> 
>  	OMAP_HSMMC_WRITE(host->base, SYSCONFIG,
> -			OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE);
> +		OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE | ENAWAKEUP);
> 
>  	if (host->id == OMAP_MMC1_DEVID) {
>  		if (host->power_mode != MMC_POWER_OFF &&
> @@ -618,7 +628,7 @@ static int omap_hsmmc_context_restore(struct
> omap_hsmmc_host *host)
>  	}
> 
>  	OMAP_HSMMC_WRITE(host->base, HCTL,
> -			OMAP_HSMMC_READ(host->base, HCTL) | hctl);
> +			OMAP_HSMMC_READ(host->base, HCTL) | hctl | IWE);
> 
>  	OMAP_HSMMC_WRITE(host->base, CAPA,
>  			OMAP_HSMMC_READ(host->base, CAPA) | capa);
> @@ -1019,6 +1029,7 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host
> *host, int status)
>  {
>  	struct mmc_data *data;
>  	int end_cmd = 0, end_trans = 0;
> +	bool card_irq = false;
> 
>  	if (!host->req_in_progress) {
>  		do {
> @@ -1032,6 +1043,9 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host
> *host, int status)
>  	data = host->data;
>  	dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
> 
> +	if (status & CIRQ)
> +		card_irq = true;
> +
>  	if (status & ERR) {
>  #ifdef CONFIG_MMC_DEBUG
>  		omap_hsmmc_report_irq(host, status);
> @@ -1087,6 +1101,9 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host
> *host, int status)
>  		omap_hsmmc_cmd_done(host, host->cmd);
>  	if ((end_trans || (status & TC)) && host->mrq)
>  		omap_hsmmc_xfer_done(host, data);
> +	if (card_irq)
> +		mmc_signal_sdio_irq(host->mmc);
> +
>  }
> 
>  /*
> @@ -1639,6 +1656,47 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc,
> struct mmc_card *card)
>  		mmc_slot(host).init_card(card);
>  }
> 
> +static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
> +{
> +	struct omap_hsmmc_host *host = mmc_priv(mmc);
> +	u32 ie, con;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&host->irq_lock, flags);
> +
> +	/*
> +	 * When interrupts are enabled, CTPL must be set to enable
> +	 * DAT1 input buffer (or the card interrupt is always
> +	 * asserted) and FCLK must be enabled as wake-up does not
> +	 * work.  Take care to disable FCLK after all the register
> +	 * accesses as they might not complete if FCLK is off.
> +	 *
> +	 * FIXME: if the MMC module (and the mmci_dat[1] GPIO when the
> +	 * CORE power domain is OFF) are configured as a wake-up
> +	 * sources in the PRCM, then FCLK could be switched off.  This
> +	 * might add too much latency.
> +	 */
> +	con = OMAP_HSMMC_READ(host->base, CON);
> +	ie = OMAP_HSMMC_READ(host->base, IE);
> +	if (enable) {
> +		clk_enable(host->fclk);
> +		ie |= CIRQ_ENABLE;
> +		con |= CTPL | CLKEXTFREE;
> +		host->sdio_int = 1;
> +	} else {
> +		ie &= ~CIRQ_ENABLE;
> +		con &= ~(CTPL | CLKEXTFREE);
> +		host->sdio_int = 0;
> +	}
> +	OMAP_HSMMC_WRITE(host->base, CON, con);
> +	OMAP_HSMMC_WRITE(host->base, IE, ie);
> +	OMAP_HSMMC_READ(host->base, IE); /* flush posted write */
> +	if (!enable)
> +		clk_disable(host->fclk);
> +
> +	spin_unlock_irqrestore(&host->irq_lock, flags);
> +}
> +
>  static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
>  {
>  	u32 hctl, capa, value;
> @@ -1653,14 +1711,14 @@ static void omap_hsmmc_conf_bus_power(struct
> omap_hsmmc_host *host)
>  	}
> 
>  	value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
> -	OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);
> +	OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl | IWE);
> 
>  	value = OMAP_HSMMC_READ(host->base, CAPA);
>  	OMAP_HSMMC_WRITE(host->base, CAPA, value | capa);
> 
>  	/* Set the controller to AUTO IDLE mode */
>  	value = OMAP_HSMMC_READ(host->base, SYSCONFIG);
> -	OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);
> +	OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE | ENAWAKEUP);
> 
>  	/* Set SD bus power bit */
>  	set_sd_bus_power(host);
> @@ -1911,7 +1969,7 @@ static const struct mmc_host_ops omap_hsmmc_ops = {
>  	.get_cd = omap_hsmmc_get_cd,
>  	.get_ro = omap_hsmmc_get_ro,
>  	.init_card = omap_hsmmc_init_card,
> -	/* NYET -- enable_sdio_irq */
> +	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
>  };
> 
>  static const struct mmc_host_ops omap_hsmmc_ps_ops = {
> @@ -1922,7 +1980,7 @@ static const struct mmc_host_ops omap_hsmmc_ps_ops = {
>  	.get_cd = omap_hsmmc_get_cd,
>  	.get_ro = omap_hsmmc_get_ro,
>  	.init_card = omap_hsmmc_init_card,
> -	/* NYET -- enable_sdio_irq */
> +	.enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
>  };
> 
>  #ifdef CONFIG_DEBUG_FS
> @@ -2139,7 +2197,7 @@ static int __init omap_hsmmc_probe(struct platform_device
> *pdev)
>  	mmc->max_seg_size = mmc->max_req_size;
> 
>  	mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
> -		     MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE;
> +		     MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE | MMC_CAP_SDIO_IRQ;
> 
>  	mmc->caps |= mmc_slot(host).caps;
>  	if (mmc->caps & MMC_CAP_8_BIT_DATA)


-- 
Sincerely yours,
Mike.

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-07  7:15                           ` Mike Rapoport
@ 2010-10-07 13:56                             ` Steve Sakoman
  2010-10-07 16:52                               ` Madhusudhan
  0 siblings, 1 reply; 29+ messages in thread
From: Steve Sakoman @ 2010-10-07 13:56 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Madhusudhan Chikkature, David Vrabel, Chris Ball, linux-mmc,
	linux-omap, Adrian Hunter

On Thu, Oct 7, 2010 at 12:15 AM, Mike Rapoport <mike@compulab.co.il> wrote:
> Hi Madhu,
>
> Madhusudhan Chikkature wrote:
>>
>> <snip>
>>
>>> You are correct!  The version of the patch in the repo indeed has
>>> 'out' in the wrong place and generates a compile error.
>>>
>>> Could you post the patch you are using and I will try to reproduce
>>> what you are seeing on my hardware?  Best we all work from exactly the
>>> same patch!
>>>
>>> Steve
>>>
>>
>> Yes. I think that check breaking the compilation is not needed. How about
>> the
>> below version? It just removes that check.
>>
>> This version should apply fine on the latest kernel. I did a sanity test
>> of
>> MMC/SD cards on OMAP4 SDP.
>>
>> Steve or Mike can check if SDIO interrupts are working.
>
> With you patch I get the same:
>
> libertas_sdio: Libertas SDIO driver
> libertas_sdio: Copyright Pierre Ossman
> libertas: command 0x0003 timed out
> libertas: Timeout submitting command 0x0003
> libertas: PREP_CMD: command 0x0003 failed: -110
> libertas_sdio: probe of mmc1:0001:1 failed with error -110

I can confirm exactly the same behavior on my hardware with this
version of the patch.

Steve

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

* RE: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-07 13:56                             ` Steve Sakoman
@ 2010-10-07 16:52                               ` Madhusudhan
  2010-10-07 17:56                                 ` Steve Sakoman
  2010-10-10  6:50                                 ` Mike Rapoport
  0 siblings, 2 replies; 29+ messages in thread
From: Madhusudhan @ 2010-10-07 16:52 UTC (permalink / raw)
  To: 'Steve Sakoman', 'Mike Rapoport'
  Cc: 'David Vrabel', 'Chris Ball', linux-mmc,
	linux-omap, 'Adrian Hunter'



> -----Original Message-----
> From: Steve Sakoman [mailto:sakoman@gmail.com]
> Sent: Thursday, October 07, 2010 8:57 AM
> To: Mike Rapoport
> Cc: Madhusudhan Chikkature; David Vrabel; Chris Ball; linux-
> mmc@vger.kernel.org; linux-omap@vger.kernel.org; Adrian Hunter
> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
> 
> On Thu, Oct 7, 2010 at 12:15 AM, Mike Rapoport <mike@compulab.co.il>
> wrote:
> > Hi Madhu,
> >
> > Madhusudhan Chikkature wrote:
> >>
> >> <snip>
> >>
> >>> You are correct!  The version of the patch in the repo indeed has
> >>> 'out' in the wrong place and generates a compile error.
> >>>
> >>> Could you post the patch you are using and I will try to reproduce
> >>> what you are seeing on my hardware?  Best we all work from exactly the
> >>> same patch!
> >>>
> >>> Steve
> >>>
> >>
> >> Yes. I think that check breaking the compilation is not needed. How
> about
> >> the
> >> below version? It just removes that check.
> >>
> >> This version should apply fine on the latest kernel. I did a sanity
> test
> >> of
> >> MMC/SD cards on OMAP4 SDP.
> >>
> >> Steve or Mike can check if SDIO interrupts are working.
> >
> > With you patch I get the same:
> >
> > libertas_sdio: Libertas SDIO driver
> > libertas_sdio: Copyright Pierre Ossman
> > libertas: command 0x0003 timed out
> > libertas: Timeout submitting command 0x0003
> > libertas: PREP_CMD: command 0x0003 failed: -110
> > libertas_sdio: probe of mmc1:0001:1 failed with error -110
> 
> I can confirm exactly the same behavior on my hardware with this
> version of the patch.
> 

Steve,

Okay. Did the version you had in your tree worked? I just want to check if I
messed up something in my patch.

Regards,
Madhu

> Steve


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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-07 16:52                               ` Madhusudhan
@ 2010-10-07 17:56                                 ` Steve Sakoman
  2010-10-10  6:50                                 ` Mike Rapoport
  1 sibling, 0 replies; 29+ messages in thread
From: Steve Sakoman @ 2010-10-07 17:56 UTC (permalink / raw)
  To: Madhusudhan
  Cc: Mike Rapoport, David Vrabel, Chris Ball, linux-mmc, linux-omap,
	Adrian Hunter

On Thu, Oct 7, 2010 at 9:52 AM, Madhusudhan <madhu.cr@ti.com> wrote:
>
>> -----Original Message-----
>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>> Sent: Thursday, October 07, 2010 8:57 AM
>> To: Mike Rapoport
>> Cc: Madhusudhan Chikkature; David Vrabel; Chris Ball; linux-
>> mmc@vger.kernel.org; linux-omap@vger.kernel.org; Adrian Hunter
>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>
>> On Thu, Oct 7, 2010 at 12:15 AM, Mike Rapoport <mike@compulab.co.il>
>> wrote:
>> > Hi Madhu,
>> >
>> > Madhusudhan Chikkature wrote:
>> >>
>> >> <snip>
>> >>
>> >>> You are correct!  The version of the patch in the repo indeed has
>> >>> 'out' in the wrong place and generates a compile error.
>> >>>
>> >>> Could you post the patch you are using and I will try to reproduce
>> >>> what you are seeing on my hardware?  Best we all work from exactly the
>> >>> same patch!
>> >>>
>> >>> Steve
>> >>>
>> >>
>> >> Yes. I think that check breaking the compilation is not needed. How
>> about
>> >> the
>> >> below version? It just removes that check.
>> >>
>> >> This version should apply fine on the latest kernel. I did a sanity
>> test
>> >> of
>> >> MMC/SD cards on OMAP4 SDP.
>> >>
>> >> Steve or Mike can check if SDIO interrupts are working.
>> >
>> > With you patch I get the same:
>> >
>> > libertas_sdio: Libertas SDIO driver
>> > libertas_sdio: Copyright Pierre Ossman
>> > libertas: command 0x0003 timed out
>> > libertas: Timeout submitting command 0x0003
>> > libertas: PREP_CMD: command 0x0003 failed: -110
>> > libertas_sdio: probe of mmc1:0001:1 failed with error -110
>>
>> I can confirm exactly the same behavior on my hardware with this
>> version of the patch.
>>
>
> Steve,
>
> Okay. Did the version you had in your tree worked? I just want to check if I
> messed up something in my patch.

No, it didn't.  Operator error -- I was "testing" a version without
the patch applied :-)  When applied it acts the same as your version.

Steve

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-07 16:52                               ` Madhusudhan
  2010-10-07 17:56                                 ` Steve Sakoman
@ 2010-10-10  6:50                                 ` Mike Rapoport
  2010-10-29 11:33                                   ` Enric Balletbò i Serra
  1 sibling, 1 reply; 29+ messages in thread
From: Mike Rapoport @ 2010-10-10  6:50 UTC (permalink / raw)
  To: Madhusudhan
  Cc: 'Steve Sakoman', 'David Vrabel',
	'Chris Ball', linux-mmc, linux-omap,
	'Adrian Hunter', Mike Rapoport

Hi Madhu,

Madhusudhan wrote:
> 
>> -----Original Message-----
>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>> Sent: Thursday, October 07, 2010 8:57 AM
>> To: Mike Rapoport
>> Cc: Madhusudhan Chikkature; David Vrabel; Chris Ball; linux-
>> mmc@vger.kernel.org; linux-omap@vger.kernel.org; Adrian Hunter
>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>
>> I can confirm exactly the same behavior on my hardware with this
>> version of the patch.
> 
> Steve,
> 
> Okay. Did the version you had in your tree worked? I just want to check if I
> messed up something in my patch.

The patch works if applied before commit 
b417577d3b9bbb06a4ddc9aa955af9bd503f7242 (omap_hsmmc: improve interrupt 
synchronisation). Apparently, changes in interrupt handling require major rework 
  of the SDIO interrupt handling...

> Regards,
> Madhu
> 
>> Steve
> 


-- 
Sincerely yours,
Mike.

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

* Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
  2010-10-10  6:50                                 ` Mike Rapoport
@ 2010-10-29 11:33                                   ` Enric Balletbò i Serra
  0 siblings, 0 replies; 29+ messages in thread
From: Enric Balletbò i Serra @ 2010-10-29 11:33 UTC (permalink / raw)
  To: Mike Rapoport
  Cc: Madhusudhan, Steve Sakoman, David Vrabel, Chris Ball, linux-mmc,
	linux-omap, Adrian Hunter

Hi all,

2010/10/10 Mike Rapoport <mike@compulab.co.il>:
> Hi Madhu,
>
> Madhusudhan wrote:
>>
>>> -----Original Message-----
>>> From: Steve Sakoman [mailto:sakoman@gmail.com]
>>> Sent: Thursday, October 07, 2010 8:57 AM
>>> To: Mike Rapoport
>>> Cc: Madhusudhan Chikkature; David Vrabel; Chris Ball; linux-
>>> mmc@vger.kernel.org; linux-omap@vger.kernel.org; Adrian Hunter
>>> Subject: Re: [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2)
>>>
>>> I can confirm exactly the same behavior on my hardware with this
>>> version of the patch.
>>
>> Steve,
>>
>> Okay. Did the version you had in your tree worked? I just want to check if
>> I
>> messed up something in my patch.
>
> The patch works if applied before commit
> b417577d3b9bbb06a4ddc9aa955af9bd503f7242 (omap_hsmmc: improve interrupt
> synchronisation). Apparently, changes in interrupt handling require major
> rework  of the SDIO interrupt handling...

On my hardware with this version of the patch and with commit
b417577d3b9bbb06a4ddc9aa955af9bd503f7242 previously applied still not
working, I'm missing something else ?

Cheers,
  Enric
>
>> Regards,
>> Madhu
>>
>>> Steve
>>
>
>
> --
> Sincerely yours,
> Mike.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

end of thread, other threads:[~2010-10-29 11:33 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 14:24 [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) David Vrabel
2010-02-22 14:24 ` [PATCH 1/2] mmc: omap_hsmmc: don't turn SDIO cards off when idle David Vrabel
2010-02-22 14:24 ` [PATCH 2/2] mmc: omap_hsmmc: enable SDIO card interrupts David Vrabel
2010-02-22 14:55 ` [PATCH 0/2] mmc: omap_hsmmc: support SDIO cards (#2) Felipe Contreras
2010-02-22 15:11   ` David Vrabel
2010-02-22 15:50     ` Felipe Contreras
2010-02-24 10:07 ` Mike Rapoport
2010-08-27 19:22 ` Chris Ball
2010-08-31  8:59   ` David Vrabel
2010-09-01 18:07     ` mike
2010-09-02  6:02     ` Mike Rapoport
2010-10-04 16:32       ` Steve Sakoman
2010-10-04 16:45         ` Madhusudhan
2010-10-04 16:57           ` Steve Sakoman
2010-10-04 17:33             ` Madhusudhan
2010-10-04 18:09               ` Steve Sakoman
2010-10-06  6:17                 ` Mike Rapoport
2010-10-06 12:55                   ` Steve Sakoman
2010-10-06 13:45                     ` Mike Rapoport
2010-10-06 15:22                       ` Steve Sakoman
2010-10-06 18:28                         ` Madhusudhan Chikkature
2010-10-06 19:02                           ` David Vrabel
2010-10-06 19:21                             ` Madhusudhan
2010-10-07  7:15                           ` Mike Rapoport
2010-10-07 13:56                             ` Steve Sakoman
2010-10-07 16:52                               ` Madhusudhan
2010-10-07 17:56                                 ` Steve Sakoman
2010-10-10  6:50                                 ` Mike Rapoport
2010-10-29 11:33                                   ` Enric Balletbò i Serra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).