From 4920bb837ad14634b8d8b257452442ac5d97a82f Mon Sep 17 00:00:00 2001 From: Per Forlin Date: Wed, 9 Nov 2011 10:55:24 +0100 Subject: mmc: mmci: optimize pre_req if no previous request Don't prepare DMA in the pre_req hook if there is no previous request. Instead, prepare DMA while start command is being issued. ST-Ericsson Linux next: N/A ST-Ericsson ID: 371812 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I0008b79cbe0e87f830365e689795f344aac3014b Signed-off-by: Per Forlin Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/36181 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Ulf HANSSON --- drivers/mmc/host/mmci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 2d3d16183c1..e3d67089265 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -593,7 +593,12 @@ static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq, if (mmci_validate_data(host, data)) return; - if (!mmci_dma_prep_next(host, data)) + /* + * Don't prepare DMA if there is no previous request, + * is_first_req is set. Instead, prepare DMA while + * start command is being issued. + */ + if (!is_first_req && !mmci_dma_prep_next(host, data)) data->host_cookie = ++nd->cookie < 0 ? 1 : nd->cookie; } -- cgit v1.2.3