[U-Boot] [PATCH 2/2] mmc: sdhci: Wait for SDHCI_INT_DATA_END when transferring.

Simon Glass sjg at chromium.org
Thu Apr 6 22:42:43 UTC 2017


On 2 April 2017 at 02:24, Alex Deymo <deymo at google.com> wrote:
> 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 at google.com>
> ---
>  drivers/mmc/sdhci.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list