u-boot/drivers/mmc
Alex Deymo 7dde50d707 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>
2017-04-14 15:23:14 +09:00
..
arm_pl180_mmci.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
arm_pl180_mmci.h mmc: Split mmc struct, rework mmc initialization (v2) 2014-03-24 12:58:56 +02:00
atmel_sdhci.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
bcm2835_sdhci.c mmc: bcm2835_sdhci: Speed up mmc writes. 2017-04-14 15:23:03 +09:00
bfin_sdh.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
davinci_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
dw_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
exynos_dw_mmc.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
fsl_esdhc_spl.c block: pass block dev not num to read/write/erase() 2016-01-13 21:05:18 -05:00
fsl_esdhc.c mmc: fsl_esdhc: support i.MX7ULP 2017-03-17 09:27:08 +01:00
ftsdc010_mci.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
gen_atmel_mci.c mmc: gen_atmel_mci: add driver model support for mci 2017-04-14 15:19:57 +09:00
hi6220_dw_mmc.c treewide: replace #include <asm-generic/errno.h> with <linux/errno.h> 2016-09-23 22:25:27 -04:00
Kconfig mmc: gen_atmel_mci: add driver model support for mci 2017-04-14 15:19:57 +09:00
kona_sdhci.c mmc: sdhci: Distinguish between base clock and maximum peripheral frequency 2017-01-23 15:37:42 +09:00
Makefile mmc: meson: add MMC driver for Meson GX (S905) 2017-04-14 15:16:06 +09:00
meson_gx_mmc.c mmc: meson: add MMC driver for Meson GX (S905) 2017-04-14 15:16:06 +09:00
mmc_boot.c mmc: squash lines for immediate return 2016-09-23 17:53:44 -04:00
mmc_legacy.c mmc: Tinification of the mmc code 2016-12-01 13:51:57 +09:00
mmc_private.h dm: mmc: Support erase 2016-10-09 21:36:27 -06:00
mmc_spi.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
mmc_write.c dm: mmc: Support erase 2016-10-09 21:36:27 -06:00
mmc-uclass.c dm: core: Add flags parameter to device_remove() 2017-04-04 20:15:10 -06:00
mmc.c mmc: drop unnecessary send_status request 2017-03-21 21:04:17 +09:00
msm_sdhci.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
mv_sdhci.c mmc: sdhci: Distinguish between base clock and maximum peripheral frequency 2017-01-23 15:37:42 +09:00
mvebu_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
mxcmmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
mxsmmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
omap_hsmmc.c mmc: omap_hsmmc: add support for CONFIG_BLK 2017-03-30 14:19:58 +09:00
pci_mmc.c mmc: sdhci: Distinguish between base clock and maximum peripheral frequency 2017-01-23 15:37:42 +09:00
pic32_sdhci.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
pxa_mmc_gen.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
rockchip_dw_mmc.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
rockchip_sdhci.c rockchip: sdhci: rk3399: update driver to support of-platdata 2017-03-16 16:03:43 -06:00
rpmb.c Move ALLOC_CACHE_ALIGN_BUFFER() to the new memalign.h header 2015-09-11 17:15:20 -04:00
s3c_sdi.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
s5p_sdhci.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
sandbox_mmc.c mmc: squash lines for immediate return 2016-09-23 17:53:44 -04:00
sdhci-cadence.c mmc: sdhci-cadence: add Cadence SD4HC support 2017-01-11 19:40:14 +09:00
sdhci.c mmc: sdhci: Wait for SDHCI_INT_DATA_END when transferring. 2017-04-14 15:23:14 +09:00
sh_mmcif.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
sh_mmcif.h ARM: Rmobile: Rename CONFIG_RMOBILE to CONFIG_ARCH_RMOBILE 2016-08-17 10:25:34 +09:00
sh_sdhi.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
socfpga_dw_mmc.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
sti_sdhci.c STiH410: Add STi SDHCI driver 2017-03-14 20:40:20 -04:00
sunxi_mmc.c mmc: change the set_ios return type from void to int 2017-01-11 19:40:13 +09:00
tangier_sdhci.c mmc: tangier: Add Intel Tangier eMMC/SDHCI driver 2017-03-21 21:03:14 +09:00
tegra_mmc.c mmc: tegra: allow disabling external clock loopback 2017-04-01 15:45:04 -07:00
uniphier-sd.c dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
xenon_sdhci.c mmc: xenon_sdhci: Add missing host->max_clk to Xenon SDHCI driver 2017-03-21 21:06:59 +09:00
zynq_sdhci.c mmc: zynq: Add fdt max-frequency support 2017-02-17 10:22:47 +01:00