Skip to content

Commit

Permalink
mmc: atmel-mci: fix incorrect setting of host->data to NULL
Browse files Browse the repository at this point in the history
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 <nicolas.ferre@atmel.com>
Cc: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Nicolas Ferre authored and Chris Ball committed Jul 22, 2012
1 parent eb6d5ae commit 41b4e9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/atmel-mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down

0 comments on commit 41b4e9a

Please sign in to comment.