Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e47c222b authored by Russell King's avatar Russell King Committed by Russell King
Browse files

[ARM] Fix potential MMCI bug



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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent db6ccbb6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);