From: Nicolas Ferre Date: Fri, 6 Jul 2012 09:58:33 +0000 (+0200) Subject: mmc: atmel-mci: fix incorrect setting of host->data to NULL X-Git-Tag: upstream/snapshot3+hdmi~7025^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41b4e9a194f69b1c945038c559ea407a6b383e81;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mmc: atmel-mci: fix incorrect setting of host->data to NULL 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 from dw_mmc by Seungwon Jeon. Signed-off-by: Nicolas Ferre Cc: Seungwon Jeon Acked-by: Ludovic Desroches Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index f2c115e..84c4ac4 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -1685,7 +1685,6 @@ static void atmci_tasklet_func(unsigned long priv) 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); @@ -1699,6 +1698,7 @@ static void atmci_tasklet_func(unsigned long priv) atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY); state = STATE_WAITING_NOTBUSY; } + host->data = NULL; break; case STATE_END_REQUEST: