]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] Fix potential MMCI bug
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 8 Jan 2007 16:42:51 +0000 (16:42 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 8 Jan 2007 19:49:51 +0000 (19:49 +0000)
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>
drivers/mmc/mmci.c

index e9b80e9202664bbfa8cd84a6b302b48ae9154560..ccfe6561be240ec65dadbbab2ea56ce0166cd001 100644 (file)
@@ -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;
 
@@ -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);