Searched hist:"7 dde50d70787eb2faeced82d0c025762b12363ea" (Results 1 – 1 of 1) sorted by relevance
| /rk3399_rockchip-uboot/drivers/mmc/ |
| H A D | sdhci.c | 7dde50d70787eb2faeced82d0c025762b12363ea Sun Apr 02 08:24:34 UTC 2017 Alex Deymo <deymo@google.com> mmc: sdhci: Wait for SDHCI_INT_DATA_END when transferring.
sdhci_transfer_data() function transfers the blocks passed up to the number of blocks defined in mmc_data, but returns immediately once all the blocks are transferred, even if the loop exit condition is not met (bit SDHCI_INT_DATA_END set in the STATUS word).
When doing multiple writes to mmc, returning right after the last block is transferred can cause the write to fail when sending the MMC_CMD_STOP_TRANSMISSION command right after the MMC_CMD_WRITE_MULTIPLE_BLOCK command, leaving the mmc driver in an unconsistent state until reboot. This error was observed in the rpi3 board.
This patch waits for the SDHCI_INT_DATA_END bit to be set even after sending all the blocks.
Test: Reliably wrote 2GiB of data to mmc in a rpi3.
Signed-off-by: Alex Deymo <deymo@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
|