* [PATCH] mmc fix for clock-off PXA255/270
@ 2008-04-25 14:06 rifx
0 siblings, 0 replies; only message in thread
From: rifx @ 2008-04-25 14:06 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
It solves the problems with clock-off in the PXA255/270 MMC/SD hardware.
This solution was testes with our devices and works good.
Kernel 2.6.24.4 (but should work with >=2.6.19).
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pxamci.c.diff --]
[-- Type: text/x-patch; name="pxamci.c.diff", Size: 1371 bytes --]
diff -NuarBb /x/work/navi_os/mmc/host/pxamci.c mmc/host/pxamci.c
--- /x/work/navi_os/mmc/host/pxamci.c 2008-03-24 19:49:18.000000000 +0100
+++ mmc/host/pxamci.c 2008-04-25 12:14:00.000000000 +0200
@@ -26,6 +26,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/mmc/host.h>
+#include <linux/mmc/mmc.h>
#include <asm/dma.h>
#include <asm/io.h>
@@ -67,6 +68,8 @@
unsigned int dma_dir;
};
+static int local_cmd = -1;
+
static void pxamci_stop_clock(struct pxamci_host *host)
{
if (readl(host->base + MMC_STAT) & STAT_CLK_EN) {
@@ -84,6 +87,7 @@
if (v & STAT_CLK_EN)
dev_err(mmc_dev(host->mmc), "unable to stop clock\n");
+ local_cmd = -1;
}
}
@@ -232,6 +235,14 @@
v = w2;
}
+ local_cmd = cmd->opcode;
+ if ((local_cmd == MMC_GO_IDLE_STATE) ||
+ (local_cmd == MMC_GO_INACTIVE_STATE) ||
+ (local_cmd == MMC_SEND_STATUS) ||
+ (local_cmd == MMC_STOP_TRANSMISSION) ||
+ (local_cmd == MMC_SET_BLOCKLEN)
+ ) pxamci_stop_clock(host);
+
if (stat & STAT_TIME_OUT_RESPONSE) {
cmd->error = -ETIMEDOUT;
} else if (stat & STAT_RES_CRC_ERR && cmd->flags & MMC_RSP_CRC) {
@@ -290,7 +301,7 @@
host->data = NULL;
if (host->mrq->stop) {
- pxamci_stop_clock(host);
+ //pxamci_stop_clock(host);
pxamci_start_cmd(host, host->mrq->stop, host->cmdat);
} else {
pxamci_finish_request(host, host->mrq);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-25 14:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-25 14:06 [PATCH] mmc fix for clock-off PXA255/270 rifx
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®