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

Commit 82788ff5 authored by Jarkko Lavinen's avatar Jarkko Lavinen Committed by Pierre Ossman
Browse files

omap_hsmmc: Do dma cleanup also with data CRC errors

parent 2a69567b
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -332,9 +332,9 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd)
/*
/*
 * DMA clean up for command errors
 * DMA clean up for command errors
 */
 */
static void mmc_dma_cleanup(struct mmc_omap_host *host)
static void mmc_dma_cleanup(struct mmc_omap_host *host, int errno)
{
{
	host->data->error = -ETIMEDOUT;
	host->data->error = errno;


	if (host->use_dma && host->dma_ch != -1) {
	if (host->use_dma && host->dma_ch != -1) {
		dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len,
		dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len,
@@ -439,7 +439,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
				end_cmd = 1;
				end_cmd = 1;
			}
			}
			if (host->data) {
			if (host->data) {
				mmc_dma_cleanup(host);
				mmc_dma_cleanup(host, -ETIMEDOUT);
				mmc_omap_reset_controller_fsm(host, SRD);
				mmc_omap_reset_controller_fsm(host, SRD);
			}
			}
		}
		}
@@ -447,9 +447,9 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
			(status & DATA_CRC)) {
			(status & DATA_CRC)) {
			if (host->data) {
			if (host->data) {
				if (status & DATA_TIMEOUT)
				if (status & DATA_TIMEOUT)
					mmc_dma_cleanup(host);
					mmc_dma_cleanup(host, -ETIMEDOUT);
				else
				else
					host->data->error = -EILSEQ;
					mmc_dma_cleanup(host, -EILSEQ);
				mmc_omap_reset_controller_fsm(host, SRD);
				mmc_omap_reset_controller_fsm(host, SRD);
				end_trans = 1;
				end_trans = 1;
			}
			}