* [PATCH 2/3]HSMMC fix for hotplug scenario with I/O in progress
@ 2008-07-25 10:33 Madhusudhan Chikkature
2008-08-05 14:04 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Madhusudhan Chikkature @ 2008-07-25 10:33 UTC (permalink / raw)
To: tony; +Cc: linux-omap
From: Madhusudhan Chikkature<madhu.cr@ti.com>
ARM: OMAP3: HSMMC fix for hotplug scenario.
This patch fixes the inconsistancy noted if the card is removed from the slot
duing an active I/O.
Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>
Signed-off-by: Romit Dasgupta <romit@ti.com>
---
drivers/mmc/host/omap_hsmmc.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
Index: linux-omap-ti.git-07142008/drivers/mmc/host/omap_hsmmc.c
===================================================================
--- linux-omap-ti.git-07142008.orig/drivers/mmc/host/omap_hsmmc.c 2008-07-17
16:07:05.000000000 +0530
+++ linux-omap-ti.git-07142008/drivers/mmc/host/omap_hsmmc.c 2008-07-17
16:08:48.000000000 +0530
@@ -85,6 +85,7 @@
#define INIT_STREAM_CMD 0x00000000
#define DUAL_VOLT_OCR_BIT 7
#define SRC (1 << 25)
+#define SRD (1 << 26)
#define OMAP_MMC1_DEVID 1
#define OMAP_MMC2_DEVID 2
@@ -301,6 +302,7 @@ static void mmc_dma_cleanup(struct mmc_o
static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
{
struct mmc_omap_host *host = dev_id;
+ struct mmc_data *data;
int end_cmd = 0, end_trans = 0, status;
if (host->cmd == NULL && host->data == NULL) {
@@ -309,6 +311,7 @@ static irqreturn_t mmc_omap_irq(int irq,
return IRQ_HANDLED;
}
+ data = host->data;
status = OMAP_HSMMC_READ(host->base, STAT);
dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
@@ -356,7 +359,7 @@ static irqreturn_t mmc_omap_irq(int irq,
if (end_cmd || (status & CC))
mmc_omap_cmd_done(host, host->cmd);
if (end_trans || (status & TC))
- mmc_omap_xfer_done(host, host->data);
+ mmc_omap_xfer_done(host, data);
return IRQ_HANDLED;
}
@@ -436,8 +439,12 @@ static void mmc_omap_detect(struct work_
host->mmc->ios.vdd = vdd;
}
mmc_detect_change(host->mmc, (HZ * 200) / 1000);
- } else
+ } else {
+ OMAP_HSMMC_WRITE(host->base, SYSCTL,
+ OMAP_HSMMC_READ(host->base, SYSCTL) | SRD);
+ while (OMAP_HSMMC_READ(host->base, SYSCTL) & SRD) ;
mmc_detect_change(host->mmc, (HZ * 50) / 1000);
+ }
}
/*
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 2/3]HSMMC fix for hotplug scenario with I/O in progress
2008-07-25 10:33 [PATCH 2/3]HSMMC fix for hotplug scenario with I/O in progress Madhusudhan Chikkature
@ 2008-08-05 14:04 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2008-08-05 14:04 UTC (permalink / raw)
To: Madhusudhan Chikkature; +Cc: linux-omap
* Madhusudhan Chikkature <madhu.cr@ti.com> [080725 13:33]:
> From: Madhusudhan Chikkature<madhu.cr@ti.com>
>
> ARM: OMAP3: HSMMC fix for hotplug scenario.
>
> This patch fixes the inconsistancy noted if the card is removed from the slot
> duing an active I/O.
Pushing today.
Tony
> Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>
> Signed-off-by: Romit Dasgupta <romit@ti.com>
> ---
> drivers/mmc/host/omap_hsmmc.c | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> Index: linux-omap-ti.git-07142008/drivers/mmc/host/omap_hsmmc.c
> ===================================================================
> --- linux-omap-ti.git-07142008.orig/drivers/mmc/host/omap_hsmmc.c 2008-07-17
> 16:07:05.000000000 +0530
> +++ linux-omap-ti.git-07142008/drivers/mmc/host/omap_hsmmc.c 2008-07-17
> 16:08:48.000000000 +0530
> @@ -85,6 +85,7 @@
> #define INIT_STREAM_CMD 0x00000000
> #define DUAL_VOLT_OCR_BIT 7
> #define SRC (1 << 25)
> +#define SRD (1 << 26)
>
> #define OMAP_MMC1_DEVID 1
> #define OMAP_MMC2_DEVID 2
> @@ -301,6 +302,7 @@ static void mmc_dma_cleanup(struct mmc_o
> static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
> {
> struct mmc_omap_host *host = dev_id;
> + struct mmc_data *data;
> int end_cmd = 0, end_trans = 0, status;
>
> if (host->cmd == NULL && host->data == NULL) {
> @@ -309,6 +311,7 @@ static irqreturn_t mmc_omap_irq(int irq,
> return IRQ_HANDLED;
> }
>
> + data = host->data;
> status = OMAP_HSMMC_READ(host->base, STAT);
> dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
>
> @@ -356,7 +359,7 @@ static irqreturn_t mmc_omap_irq(int irq,
> if (end_cmd || (status & CC))
> mmc_omap_cmd_done(host, host->cmd);
> if (end_trans || (status & TC))
> - mmc_omap_xfer_done(host, host->data);
> + mmc_omap_xfer_done(host, data);
>
> return IRQ_HANDLED;
> }
> @@ -436,8 +439,12 @@ static void mmc_omap_detect(struct work_
> host->mmc->ios.vdd = vdd;
> }
> mmc_detect_change(host->mmc, (HZ * 200) / 1000);
> - } else
> + } else {
> + OMAP_HSMMC_WRITE(host->base, SYSCTL,
> + OMAP_HSMMC_READ(host->base, SYSCTL) | SRD);
> + while (OMAP_HSMMC_READ(host->base, SYSCTL) & SRD) ;
> mmc_detect_change(host->mmc, (HZ * 50) / 1000);
> + }
> }
>
> /*
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-05 14:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25 10:33 [PATCH 2/3]HSMMC fix for hotplug scenario with I/O in progress Madhusudhan Chikkature
2008-08-05 14:04 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox