Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284503
b: refs/heads/master
c: 053b3ce
h: refs/heads/master
i:
  284501: 67431f6
  284499: 34ce9b2
  284495: 48c8218
v: v3
  • Loading branch information
Seungwon Jeon authored and Chris Ball committed Jan 12, 2012
1 parent cf95cff commit 835056a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 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: 5b93a4595b6c39f78b69cc6eb9a3fa0ae6efe4a6
refs/heads/master: 053b3ce6c15f0199c20b3fb06c3ae479de0324e2
34 changes: 28 additions & 6 deletions trunk/drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,11 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
mci_writel(host, CTYPE, (slot->ctype << slot->id));
}

static void dw_mci_start_request(struct dw_mci *host,
struct dw_mci_slot *slot)
static void __dw_mci_start_request(struct dw_mci *host,
struct dw_mci_slot *slot,
struct mmc_command *cmd)
{
struct mmc_request *mrq;
struct mmc_command *cmd;
struct mmc_data *data;
u32 cmdflags;

Expand All @@ -610,14 +610,13 @@ static void dw_mci_start_request(struct dw_mci *host,
host->completed_events = 0;
host->data_status = 0;

data = mrq->data;
data = cmd->data;
if (data) {
dw_mci_set_timeout(host);
mci_writel(host, BYTCNT, data->blksz*data->blocks);
mci_writel(host, BLKSIZ, data->blksz);
}

cmd = mrq->cmd;
cmdflags = dw_mci_prepare_command(slot->mmc, cmd);

/* this is the first command, send the initialization clock */
Expand All @@ -635,6 +634,16 @@ static void dw_mci_start_request(struct dw_mci *host,
host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop);
}

static void dw_mci_start_request(struct dw_mci *host,
struct dw_mci_slot *slot)
{
struct mmc_request *mrq = slot->mrq;
struct mmc_command *cmd;

cmd = mrq->sbc ? mrq->sbc : mrq->cmd;
__dw_mci_start_request(host, slot, cmd);
}

/* must be called with host->lock held */
static void dw_mci_queue_request(struct dw_mci *host, struct dw_mci_slot *slot,
struct mmc_request *mrq)
Expand Down Expand Up @@ -889,7 +898,14 @@ static void dw_mci_tasklet_func(unsigned long priv)
cmd = host->cmd;
host->cmd = NULL;
set_bit(EVENT_CMD_COMPLETE, &host->completed_events);
dw_mci_command_complete(host, host->mrq->cmd);
dw_mci_command_complete(host, cmd);
if (cmd == host->mrq->sbc && !cmd->error) {
prev_state = state = STATE_SENDING_CMD;
__dw_mci_start_request(host, host->cur_slot,
host->mrq->cmd);
goto unlock;
}

if (!host->mrq->data || cmd->error) {
dw_mci_request_end(host, host->mrq);
goto unlock;
Expand Down Expand Up @@ -967,6 +983,12 @@ static void dw_mci_tasklet_func(unsigned long priv)
goto unlock;
}

if (host->mrq->sbc && !data->error) {
data->stop->error = 0;
dw_mci_request_end(host, host->mrq);
goto unlock;
}

prev_state = state = STATE_SENDING_STOP;
if (!data->error)
send_stop_cmd(host, data);
Expand Down

0 comments on commit 835056a

Please sign in to comment.