On Thu, Sep 06, 2012 at 09:40:48AM +0200, Javier Martin wrote: > The problem can be easily reproduced using a script that loops > copying a file in an SD card to another place in the same SD card > and its related to read transfers. This only happens with DMA enabled. > > This is related to the fact that, when reading, an MMC irq signals > the fact that all data from the SD card has been copied to the > internal buffers. However, it doesn't signal whether the DMA transfer > that is in charge of moving data from these internal buffers to RAM > has finished or not. Thus, calling dmaengine_terminate_all() in the > MMC irq routine can cancel an ongoing DMA transfer leaving some data > in the internal buffers that produces an accumulative effect which, > in the end, blocks a read data transfer forever. Doesn't that mean that in case of a DMA read we just have to wait for the DMA callback instead of the MMC irq? Something like: static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd, unsigned int cmdat) { ... if (mxcmci_use_dma(host)) { if (host->dma_dir == DMA_FROM_DEVICE) setup_dma_callback(); else int_cntr |= INT_WRITE_OP_DONE_EN; } ... } That would be a cleaner solution I think. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html