blob: cbf5c45e7b0541e820068af53133c1fbbfeb07c3 [file] [log] [blame]
From 6200f62344e4ab0492623a51fabdac4e57ba6e89 Mon Sep 17 00:00:00 2001
From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Fri, 6 Jul 2012 11:49:05 +0200
Subject: mmc: atmel-mci: fix incorrect setting of host->data to NULL
commit 41b4e9a194f69b1c945038c559ea407a6b383e81 upstream.
Setting host->data to NULL is incorrect sequence in STATE_SENDING_STOP
state of FSM: This early setting leads to the skip of dma_unmap_sg()
in atmci_dma_cleanup() which is a bug.
Idea taken form dw_mmc by Seungwon Jeon.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Seungwon Jeon <tgih.jun@samsung.com>
---
drivers/mmc/host/atmel-mci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1767,7 +1767,6 @@ static void atmci_tasklet_func(unsigned
dev_dbg(&host->pdev->dev, "FSM: cmd ready\n");
host->cmd = NULL;
- host->data = NULL;
data->bytes_xfered = data->blocks * data->blksz;
data->error = 0;
atmci_command_complete(host, mrq->stop);
@@ -1781,6 +1780,7 @@ static void atmci_tasklet_func(unsigned
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
state = STATE_WAITING_NOTBUSY;
}
+ host->data = NULL;
break;
case STATE_END_REQUEST: