From patchwork Fri Apr 29 17:11:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 741651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3THB50H030516 for ; Fri, 29 Apr 2011 17:11:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759857Ab1D2RLF (ORCPT ); Fri, 29 Apr 2011 13:11:05 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:55616 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759147Ab1D2RLD (ORCPT ); Fri, 29 Apr 2011 13:11:03 -0400 Received: from axis700.grange (pD9EB9180.dip0.t-ipconnect.de [217.235.145.128]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0M67Pm-1Pqtgc2bHu-00xPi8; Fri, 29 Apr 2011 19:11:00 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 52948189B89; Fri, 29 Apr 2011 19:11:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 4FB69189B88; Fri, 29 Apr 2011 19:11:00 +0200 (CEST) Date: Fri, 29 Apr 2011 19:11:00 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-mmc@vger.kernel.org, Magnus Damm , Simon Horman , Ian Molton Subject: [PATCH] mmc: tmio: fix PM in DMA mode Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:hxKM9CAsp5Bx7Eemo0pnP+/1a6Phdxf0DQJupAB7hSl Dte0y512v4HqnmoCJMYlR2if1gcHNFk5QdJd52l8aF8O5OUeFB i1trbxTczXlf4FonR1qn5bFe0UGCJ2IwTz+L6L8NvN3Cqk0R+V gMJ9kljE9mYSaCqIFC8OVn6FPgkVuCHTpUBbgDUcEBSAlKF8Ln +AyV5TF6IT4YfoimkRVslKB1SOXLVR2AUymvPApxFw= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Apr 2011 17:11:06 +0000 (UTC) DMA mode has to be re-enabled during a resume. Signed-off-by: Guennadi Liakhovetski --- drivers/mmc/host/tmio_mmc_dma.c | 21 ++++++++++++--------- drivers/mmc/host/tmio_mmc_pio.c | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index d3de74a..25f1ad6 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c @@ -256,7 +256,10 @@ static bool tmio_mmc_filter(struct dma_chan *chan, void *arg) void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata) { /* We can only either use DMA for both Tx and Rx or not use it at all */ - if (pdata->dma) { + if (!pdata->dma) + return; + + if (!host->chan_tx && !host->chan_rx) { dma_cap_mask_t mask; dma_cap_zero(mask); @@ -284,18 +287,18 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat tasklet_init(&host->dma_complete, tmio_mmc_tasklet_fn, (unsigned long)host); tasklet_init(&host->dma_issue, tmio_mmc_issue_tasklet_fn, (unsigned long)host); + } - tmio_mmc_enable_dma(host, true); + tmio_mmc_enable_dma(host, true); + + return; - return; ebouncebuf: - dma_release_channel(host->chan_rx); - host->chan_rx = NULL; + dma_release_channel(host->chan_rx); + host->chan_rx = NULL; ereqrx: - dma_release_channel(host->chan_tx); - host->chan_tx = NULL; - return; - } + dma_release_channel(host->chan_tx); + host->chan_tx = NULL; } void tmio_mmc_release_dma(struct tmio_mmc_host *host) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 26598f1..27fc11c 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -995,6 +995,7 @@ int tmio_mmc_host_resume(struct device *dev) pm_runtime_get_sync(dev); tmio_mmc_reset(mmc_priv(mmc)); + tmio_mmc_request_dma(host, host->pdata); return mmc_resume_host(mmc); }