Skip to content

Commit

Permalink
mmc: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCNelson committed Nov 12, 2013
1 parent 17efc97 commit bd87b00
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ am33x_after () {
${git} "${DIR}/patches/fixes/0001-sync-don-t-block-the-flusher-thread-waiting-on-IO.patch"
${git} "${DIR}/patches/fixes/0002-USB-Fix-USB-device-disconnects-on-resume.patch"
${git} "${DIR}/patches/fixes/0003-beaglebone-switch-uSD-to-4-bit-mode.patch"
${git} "${DIR}/patches/fixes/0004-mmc-omap_hsmmc-clear-status-flags-before-starting-a-.patch"

echo "dir: firmware"
#http://arago-project.org/git/projects/?p=am33x-cm3.git;a=summary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From 38b650a239a6b47a43eaf12123d6885b0cbc596e Mon Sep 17 00:00:00 2001
From: Francesco Lavra <[email protected]>
Date: Sat, 29 Jun 2013 06:25:12 +0000
Subject: [PATCH 4/4] mmc: omap_hsmmc: clear status flags before starting a new
command

Commit 1f6b9fa40e76fffaaa0b3bd6a0bfdcf1cdc06efa consolidated writes to
the STAT register in one location, moving them from omap_hsmmc_do_irq()
to omap_hsmmc_irq(). This move has the unwanted side effect that the
controller status flags are potentially cleared after a new command has
been started as a consequence of reading the previous status flags.
This means that if the new command changes the status flags before the
IRQ routine returns, those flags may be cleared without handling the
event which asserted them, and thus missing the event.
Move the writing of the STAT register back in omap_hsmmc_do_irq(),
before handling the status flags which generated the interrupt.

Signed-off-by: Francesco Lavra <[email protected]>
Reviewed-and-Tested-by: Balaji T K <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
---
drivers/mmc/host/omap_hsmmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e2b97df..04daf72 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1070,6 +1070,7 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
}
}

+ OMAP_HSMMC_WRITE(host->base, STAT, status);
if (end_cmd || ((status & CC_EN) && host->cmd))
omap_hsmmc_cmd_done(host, host->cmd);
if ((end_trans || (status & TC_EN)) && host->mrq)
@@ -1089,7 +1090,6 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
omap_hsmmc_do_irq(host, status);

/* Flush posted write */
- OMAP_HSMMC_WRITE(host->base, STAT, status);
status = OMAP_HSMMC_READ(host->base, STAT);
}

--
1.8.4.2

2 changes: 1 addition & 1 deletion version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ linaro_toolchain="cortex_gcc_4_7"
#Kernel/Build
KERNEL_REL=3.8
KERNEL_TAG=${KERNEL_REL}.13
BUILD=bone28
BUILD=bone28.1

#v3.X-rcX + upto SHA
#KERNEL_SHA=""
Expand Down

0 comments on commit bd87b00

Please sign in to comment.