Skip to content

Commit

Permalink
[ARM] Fix potential MMCI bug
Browse files Browse the repository at this point in the history
The MMCI driver might end up aborting the initial command and leaving
the data part of the command sequence still in place.  Avoid this
problem by ensuring that any data sequence is properly cleared out
when a command completes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jan 8, 2007
1 parent db6ccbb commit e47c222
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mmc/mmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
{
writel(0, host->base + MMCICOMMAND);

BUG_ON(host->data);

host->mrq = NULL;
host->cmd = NULL;

Expand Down Expand Up @@ -198,6 +200,8 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
}

if (!cmd->data || cmd->error != MMC_ERR_NONE) {
if (host->data)
mmci_stop_data(host);
mmci_request_end(host, cmd->mrq);
} else if (!(cmd->data->flags & MMC_DATA_READ)) {
mmci_start_data(host, cmd->data);
Expand Down

0 comments on commit e47c222

Please sign in to comment.