u-boot/drivers/mmc
Hai Pham 0ac2cca3a4 mmc: Introduce mmc_send_stop_transmission()
If a tuning command times out, the card could still be processing it,
which will cause problems for recovery. The eMMC specification section
6.6 Data transfer mode (cont’d) claims that CMD12 can be used to stop
CMD21:
"
The relationship between the various data transfer modes is summarized (see Figure 27):
- All data read commands can be aborted any time by the stop command (CMD12).
  The data transfer will terminate and the Device will return to the Transfer State.
  The read commands are: ... send tuning block (CMD21) ....
"
Add a function that does that.

Based on Linux commit [1] and [2].

[1] e711f0309109 ("mmc: mmc: Introduce mmc_abort_tuning()")
[2] 21adc2e45f4e ("mmc: Improve function name when aborting a tuning
cmd")

Reviewed-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update commit message, quote relevant part of the specification.
        Rename to mmc_send_stop_transmission().
	Remove tuning opcode check, this is controller driver specific.
	Deduplicate part of mmc_read_blocks() using this function.]
Reviewed-by:  Peng Fan <peng.fan@nxp.com>
2023-07-18 09:17:16 +09:00
..
am654_sdhci.c drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
arm_pl180_mmci.c mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCI 2021-10-29 18:22:32 +09:00
arm_pl180_mmci.h mmc: arm_pl180_mmci: Enable HWFC for specific versions of MCI 2021-10-29 18:22:32 +09:00
aspeed_sdhci.c mmc/aspeed: Enable controller clocks 2022-07-06 14:31:29 -04:00
atmel_sdhci.c mmc: atmel_sdhci: re-enable sdhci after SD Card re-insertion 2022-09-19 09:50:17 +03:00
bcm2835_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
bcm2835_sdhost.c mmc: bcm2835-host: let firmware manage the clock divisor 2023-03-24 14:43:20 +00:00
bcmstb_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
ca_dw_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
davinci_mmc.c drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
dw_mmc.c mmc: dwmmc: only clear handled interrupts 2022-10-24 18:02:41 +09:00
exynos_dw_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
f_sdh30.c mmc: f_sdh30: Add support for F_SDH30_E51 2022-10-24 18:01:32 +09:00
fsl_esdhc.c global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
fsl_esdhc_imx.c Convert CONFIG_FSL_ESDHC_PIN_MUX to Kconfig 2022-12-22 10:31:48 -05:00
fsl_esdhc_spl.c global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
ftsdc010_mci.c mmc: ftsdc010: make command timeout 250 ms as in the comment 2022-10-24 18:01:07 +09:00
ftsdc010_mci.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gen_atmel_mci.c global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
hi6220_dw_mmc.c mmc: hi6220_dw_mmc: add compatible for HC2910 support 2023-05-03 09:05:24 -04:00
iproc_sdhci.c drivers: mmc: iproc_sdhci: enable HS200 mode 2021-03-02 13:53:37 +01:00
jz_mmc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
Kconfig mmc: sdhci: Allow disabling of SDMA in SPL 2023-04-21 15:55:29 +08:00
kona_sdhci.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
Makefile mmc: remove SDHCI SPEAR 2023-03-06 17:03:56 -05:00
meson_gx_mmc.c mmc: meson_gx_mmc: use mmc_pwrseq instead of meson_mmc_pwrseq 2021-02-19 15:10:46 +08:00
meson_gx_mmc.h dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mmc-pwrseq.c mmc: pwrseq: add mmc-pwrseq file to provide a generic interface 2021-02-19 15:10:41 +08:00
mmc-uclass.c dm: mmc: Use bootdev_setup_sibling_blk() 2023-01-23 18:11:39 -05:00
mmc.c mmc: Introduce mmc_send_stop_transmission() 2023-07-18 09:17:16 +09:00
mmc_boot.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
mmc_bootdev.c bootstd: Use bootdev instead of bootdevice 2023-07-16 23:13:17 +08:00
mmc_legacy.c blk: Rename if_type to uclass_id 2022-09-25 08:30:05 -06:00
mmc_private.h doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
mmc_spi.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
mmc_write.c mmc: erase: Use TRIM erase when available 2023-04-10 12:17:24 +09:00
msm_sdhci.c mmc: msm_sdhci: Add SDCC version 5.0.0 support 2022-07-25 13:02:04 -04:00
mtk-sd.c mmc: mediatek: add support for MediaTek MT7891/MT7986 SoCs 2022-09-23 15:09:15 -04:00
mv_sdhci.c mmc: mv_sdhci: Depend on DM_MMC 2023-04-10 12:17:58 +09:00
mvebu_mmc.c mmc: mvebu: convert to driver model 2021-04-08 08:50:52 +02:00
mxcmmc.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
mxsmmc.c treewide: Simply conditions with the new OF_REAL 2021-09-25 09:46:15 -06:00
nexell_dw_mmc.c mmc: dwmmc: Change designware MMC 'clksel' callback function to return status 2021-01-15 17:48:36 +08:00
npcm_sdhci.c mmc: npcm_sdhci: Fix use of CONFIG_IS_ENABLED on DM_REGULATOR 2023-04-08 03:53:23 +02:00
octeontx_hsmmc.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
octeontx_hsmmc.h mmc: Add MMC controller driver for OcteonTX / TX2 2020-08-25 08:01:16 +02:00
omap_hsmmc.c dm: treewide: Use uclass_first_device_err when accessing one device 2022-10-17 21:17:12 -06:00
owl_mmc.c mmc: actions: add MMC driver for Actions OWL S700/S900 2022-01-18 12:48:17 -05:00
pci_mmc.c mmc: pci_mmc.c should build with ACPIGEN=n 2022-07-27 15:19:42 +09:00
pic32_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
piton_mmc.c drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
renesas-sdhi.c mmc: renesas-sdhi: Add R-Car Gen4 support 2023-04-07 17:13:28 +02:00
rockchip_dw_mmc.c mmc: rockchip_dw_mmc: Fix get_mmc_clk return value 2023-03-19 13:20:21 +08:00
rockchip_sdhci.c mmc: rockchip_sdhci: Disable DMA mode using a device tree property 2023-05-18 08:34:45 +08:00
rpmb.c mmc: rpmb: Fix driver routing memory alignment with tmp buffer 2021-07-30 17:12:15 +08:00
s5p_sdhci.c Revert "mmc: s5p_sdhci: unset the SDHCI_QUIRK_BROKEN_R1B" 2023-05-15 17:14:46 -04:00
sandbox_mmc.c sandbox: mmc: Start off with a zeroed file 2023-01-23 18:11:39 -05:00
sdhci-adma.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
sdhci-cadence.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sdhci.c mmc: sdhci: Allow disabling of SDMA in SPL 2023-04-21 15:55:29 +08:00
sh_mmcif.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
sh_mmcif.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sh_sdhi.c global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
snps_dw_mmc.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
socfpga_dw_mmc.c mmc: dwmmc: socfpga: Get "fifo-mode" property from DT 2021-06-22 12:02:32 +08:00
sti_sdhci.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
stm32_sdmmc2.c mmc: stm32_sdmmc2: manage vqmmc 2022-10-24 18:02:15 +09:00
sunxi_mmc.c sunxi: mmc: group non-DM specific functions 2023-01-21 01:32:23 +00:00
tangier_sdhci.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
tegra_mmc.c drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
tmio-common.c mmc: tmio: Use IS_ENABLED() to check for CONFIG_ option 2023-04-16 16:16:20 +02:00
tmio-common.h mmc: tmio: Replace ifdeffery with IS_ENABLED/CONFIG_IS_ENABLED macros 2023-04-07 17:13:27 +02:00
uniphier-sd.c dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
xenon_sdhci.c drivers: use devfdt_get_addr_index_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
zynq_sdhci.c mmc: zynq: Sync with upstream DT binding 2023-06-12 13:24:31 +02:00