Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140477
b: refs/heads/master
c: 4a694dc
h: refs/heads/master
i:
  140475: 798ca8a
v: v3
  • Loading branch information
Adrian Hunter authored and Pierre Ossman committed Mar 24, 2009
1 parent 76d7ccc commit 563f33f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82788ff532f75ecd23166e677c970139ff61c363
refs/heads/master: 4a694dc915c9a223044ce21fc0d99e63facd1d64
38 changes: 29 additions & 9 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ struct mmc_omap_host {
int initstr;
int slot_id;
int dbclk_enabled;
int response_busy;
struct omap_mmc_platform_data *pdata;
};

Expand Down Expand Up @@ -244,10 +245,14 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd,
OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);

host->response_busy = 0;
if (cmd->flags & MMC_RSP_PRESENT) {
if (cmd->flags & MMC_RSP_136)
resptype = 1;
else
else if (cmd->flags & MMC_RSP_BUSY) {
resptype = 3;
host->response_busy = 1;
} else
resptype = 2;
}

Expand Down Expand Up @@ -282,6 +287,15 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd,
static void
mmc_omap_xfer_done(struct mmc_omap_host *host, struct mmc_data *data)
{
if (!data) {
struct mmc_request *mrq = host->mrq;

host->mrq = NULL;
mmc_omap_fclk_lazy_disable(host);
mmc_request_done(host->mmc, mrq);
return;
}

host->data = NULL;

if (host->use_dma && host->dma_ch != -1)
Expand Down Expand Up @@ -323,7 +337,7 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd)
cmd->resp[0] = OMAP_HSMMC_READ(host->base, RSP10);
}
}
if (host->data == NULL || cmd->error) {
if ((host->data == NULL && !host->response_busy) || cmd->error) {
host->mrq = NULL;
mmc_request_done(host->mmc, cmd->mrq);
}
Expand Down Expand Up @@ -413,7 +427,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
struct mmc_data *data;
int end_cmd = 0, end_trans = 0, status;

if (host->cmd == NULL && host->data == NULL) {
if (host->mrq == NULL) {
OMAP_HSMMC_WRITE(host->base, STAT,
OMAP_HSMMC_READ(host->base, STAT));
return IRQ_HANDLED;
Expand All @@ -438,18 +452,24 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
}
end_cmd = 1;
}
if (host->data) {
mmc_dma_cleanup(host, -ETIMEDOUT);
if (host->data || host->response_busy) {
if (host->data)
mmc_dma_cleanup(host, -ETIMEDOUT);
host->response_busy = 0;
mmc_omap_reset_controller_fsm(host, SRD);
}
}
if ((status & DATA_TIMEOUT) ||
(status & DATA_CRC)) {
if (host->data) {
if (status & DATA_TIMEOUT)
mmc_dma_cleanup(host, -ETIMEDOUT);
if (host->data || host->response_busy) {
int err = (status & DATA_TIMEOUT) ?
-ETIMEDOUT : -EILSEQ;

if (host->data)
mmc_dma_cleanup(host, err);
else
mmc_dma_cleanup(host, -EILSEQ);
host->mrq->cmd->error = err;
host->response_busy = 0;
mmc_omap_reset_controller_fsm(host, SRD);
end_trans = 1;
}
Expand Down

0 comments on commit 563f33f

Please sign in to comment.