diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2017-02-17 19:22:41 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-04-24 21:41:14 +0200 |
commit | 52ad9a8e854ca13151f4af8140297f73d49e318a (patch) | |
tree | 0d623e49de4a6b02f452e3f48dc0ff8452eac710 /include | |
parent | 21b22284619bbb201775c125af53f2834eb91674 (diff) | |
download | linux-52ad9a8e854ca13151f4af8140297f73d49e318a.tar.bz2 |
mmc: tmio: ensure end of DMA and SD access are in sync
The current code assumes that DMA is finished before SD access end is
flagged. Thus, it schedules the 'dma_complete' tasklet in the SD card
interrupt routine when DATAEND is set. The assumption is not safe,
though. Even by mounting an SD card, it can be seen that sometimes DMA
complete is first, sometimes DATAEND. It seems they are usually close
enough timewise to not cause problems. However, a customer reported that
with CMD53 sometimes things really break apart. As a result, the BSP has
a patch which introduces flags for both events and makes sure both flags
are set before scheduling the tasklet. The customer accepted the patch,
yet it doesn't seem a proper upstream solution to me.
This patch refactors the code to replace the tasklet with already
existing and more lightweight mechanisms. First of all, we set the
callback in a DMA descriptor to automatically get notified when DMA is
done. In the callback, we then use a completion to make sure the SD
access has already ended. Then, we proceed as before.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions