linux/drivers/mmc/host
Yann Gautier 774514bf97 mmc: mmci: Add MMC_CAP_NEED_RSP_BUSY for the stm32 variants
An issue has been observed on STM32MP157C-EV1 board, with an erase command
with secure erase argument, ending up waiting for ~4 hours before timeout.

The requested busy timeout from the mmc core ends up with 14784000ms (~4
hours), but the supported host->max_busy_timeout is 86767ms, which leads to
that the core switch to use an R1 response in favor of the R1B and polls
for busy with the host->card_busy() ops. In this case the polling doesn't
work as expected, as we never detects that the card stops signaling busy,
which leads to the following message:

 mmc1: Card stuck being busy! __mmc_poll_for_busy

The problem boils done to that the stm32 variants can't use R1 responses in
favor of R1B responses, as it leads to an internal state machine in the
controller to get stuck. To continue to process requests, it would need to
be reset.

To fix this problem, let's set MMC_CAP_NEED_RSP_BUSY for the stm32 variant,
which prevent the mmc core from switching to R1 responses. Additionally,
let's cap the cmd->busy_timeout to the host->max_busy_timeout, thus rely on
86767ms to be sufficient (~66 seconds was need for this test case).

Fixes: 94fe2580a2 ("mmc: core: Enable erase/discard/trim support for all mmc hosts")
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Link: https://lore.kernel.org/r/20210225145454.12780-1-yann.gautier@foss.st.com
Cc: stable@vger.kernel.org
[Ulf: Simplified the code and extended the commit message]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-09 10:00:52 +01:00
..
alcor.c
atmel-mci.c mmc: atmel-mci: Use new tasklet API 2021-02-08 13:00:31 +01:00
au1xmmc.c mmc: au1xmmc: Use new tasklet API 2021-02-08 13:00:31 +01:00
bcm2835.c
cavium-octeon.c
cavium-thunderx.c
cavium.c mmc: cavium: Replace spin_lock_irqsave with spin_lock in hard IRQ 2021-02-08 12:57:16 +01:00
cavium.h
cb710-mmc.c mmc: cb710: Use new tasklet API 2021-02-15 10:43:23 +01:00
cb710-mmc.h
cqhci-core.c mmc: cqhci: add support for inline encryption 2021-02-01 12:02:33 +01:00
cqhci-crypto.c mmc: cqhci: add cqhci_host_ops::program_key 2021-02-01 12:02:33 +01:00
cqhci-crypto.h mmc: cqhci: add support for inline encryption 2021-02-01 12:02:33 +01:00
cqhci.h mmc: cqhci: add cqhci_host_ops::program_key 2021-02-01 12:02:33 +01:00
davinci_mmc.c mmc: davinci: remove unneeded semicolon 2020-11-16 11:59:28 +01:00
dw_mmc-bluefield.c
dw_mmc-exynos.c
dw_mmc-exynos.h
dw_mmc-hi3798cv200.c
dw_mmc-k3.c
dw_mmc-pci.c
dw_mmc-pltfm.c
dw_mmc-pltfm.h
dw_mmc-rockchip.c
dw_mmc.c mmc: dw_mmc: Use new tasklet API 2021-02-08 13:00:31 +01:00
dw_mmc.h
jz4740_mmc.c mmc: jz4740: remove unused struct component card_detect_irq 2021-02-01 11:54:44 +01:00
Kconfig mmc: host: Retire MMC_GOLDFISH 2021-02-15 10:43:23 +01:00
Makefile mmc: host: Retire MMC_GOLDFISH 2021-02-15 10:43:23 +01:00
meson-gx-mmc.c mmc: meson-gx: check for scatterlist size alignment in block mode 2021-02-01 11:54:43 +01:00
meson-mx-sdhc-clkc.c
meson-mx-sdhc-mmc.c
meson-mx-sdhc.h
meson-mx-sdio.c mmc: meson-mx-sdio: replace spin_lock_irqsave by spin_lock in hard IRQ 2020-11-16 11:59:29 +01:00
mmc_hsq.c
mmc_hsq.h
mmc_spi.c
mmci.c mmc: mmci: Add MMC_CAP_NEED_RSP_BUSY for the stm32 variants 2021-03-09 10:00:52 +01:00
mmci.h
mmci_qcom_dml.c
mmci_stm32_sdmmc.c
moxart-mmc.c mmc: moxart: replace spin_lock_irqsave by spin_lock in hard IRQ 2020-11-16 11:59:29 +01:00
mtk-sd.c mmc: mediatek: fix race condition between msdc_request_timeout and irq 2021-02-01 11:54:43 +01:00
mvsdio.c
mvsdio.h
mxcmmc.c mmc: mxc: Convert the driver to DT-only 2020-11-24 15:18:19 +01:00
mxs-mmc.c mmc: mxs-mmc: Fix a resource leak in an error handling path in 'mxs_mmc_probe()' 2021-02-01 11:54:41 +01:00
of_mmc_spi.c
omap.c mmc: omap: Use new tasklet API 2021-02-08 13:00:31 +01:00
omap_hsmmc.c mmc: omap_hsmmc: Simplify bool comparison and conversion 2021-02-01 11:54:47 +01:00
owl-mmc.c mmc: owl-mmc: Fix a resource leak in an error handling path and in the remove function 2021-02-01 11:54:42 +01:00
pxamci.c mmc: pxamci: Fix error return code in pxamci_probe 2020-11-24 12:35:34 +01:00
pxamci.h
renesas_sdhi.h
renesas_sdhi_core.c mmc: renesas_sdhi: Add a condition of cmd/data timeout for retune 2021-02-01 11:54:43 +01:00
renesas_sdhi_internal_dmac.c mmc: renesas_internal_dmac: add pre_req and post_req support 2021-02-01 11:54:43 +01:00
renesas_sdhi_sys_dmac.c
rtsx_pci_sdmmc.c mmc: rtsx: add delay before power on 2021-02-01 11:54:45 +01:00
rtsx_usb_sdmmc.c
s3cmci.c mmc: s3cmci: Use new tasklet API 2021-02-08 13:00:31 +01:00
s3cmci.h
sdhci-acpi.c mmc: sdhci-acpi: AMDI0040: Allow changing HS200/HS400 driver strength 2020-11-16 11:59:27 +01:00
sdhci-bcm-kona.c
sdhci-brcmstb.c mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend 2021-01-13 12:06:37 +01:00
sdhci-cadence.c
sdhci-cns3xxx.c
sdhci-dove.c
sdhci-esdhc-imx.c mmc: sdhci-esdhc-imx: fix kernel panic when remove module 2021-02-15 10:43:23 +01:00
sdhci-esdhc-mcf.c
sdhci-esdhc.h
sdhci-iproc.c mmc: sdhci-iproc: Add ACPI bindings for the RPi 2021-02-01 11:54:48 +01:00
sdhci-milbeaut.c
sdhci-msm.c mmc: sdhci-msm: add Inline Crypto Engine support 2021-02-01 12:02:34 +01:00
sdhci-of-arasan.c mmc: sdhci-of-arasan: Use dev_err_probe() to avoid spamming logs 2021-02-01 11:54:46 +01:00
sdhci-of-aspeed-test.c mmc: sdhci-of-aspeed: Fix kunit-related build error 2021-02-01 11:54:49 +01:00
sdhci-of-aspeed.c mmc: sdhci-of-aspeed: Fix kunit-related build error 2021-02-01 11:54:49 +01:00
sdhci-of-at91.c
sdhci-of-dwcmshc.c mmc: sdhci-of-dwcmshc: set SDHCI_QUIRK2_PRESET_VALUE_BROKEN 2021-02-01 11:54:42 +01:00
sdhci-of-esdhc.c mmc: sdhci-of-esdhc: Handle pulse width detection erratum for more SoCs 2020-11-10 13:20:37 +01:00
sdhci-of-hlwd.c
sdhci-of-sparx5.c
sdhci-omap.c
sdhci-pci-arasan.c
sdhci-pci-core.c mmc: sdhci-pci: Prefer SDR25 timing for High Speed mode for BYT-based Intel controllers 2020-11-17 12:33:06 +01:00
sdhci-pci-data.c
sdhci-pci-dwc-mshc.c
sdhci-pci-gli.c mmc: sdhci-pci-gli: Finetune HS400 RX delay for GL9763E 2021-02-01 11:54:46 +01:00
sdhci-pci-o2micro.c mmc: sdhci-pci-o2micro: Bug fix for SDR104 HW tuning failure 2021-02-15 10:37:57 +01:00
sdhci-pci.h
sdhci-pic32.c mmc: sdhci-pic32: Make pic32_sdhci_probe_platform() void 2020-11-16 11:59:30 +01:00
sdhci-pltfm.c
sdhci-pltfm.h mmc: sdhci-pltfm: Fix linking err for sdhci-brcmstb 2021-02-01 11:13:09 +01:00
sdhci-pxav2.c
sdhci-pxav3.c
sdhci-s3c.c
sdhci-spear.c
sdhci-sprd.c mmc: sdhci-sprd: Fix some resource leaks in the remove function 2021-02-01 11:54:42 +01:00
sdhci-st.c mmc: sdhci-st: drop of_match_ptr from of_device_id table 2020-11-24 11:26:55 +01:00
sdhci-tegra.c mmc: sdhci: tegra: fix wrong unit with busy_timeout 2020-11-17 12:45:27 +01:00
sdhci-xenon-phy.c mmc: sdhci-xenon: switch to device_* API 2020-12-11 10:08:37 +01:00
sdhci-xenon.c mmc: xenon: add AP807 compatible string 2021-02-01 11:54:45 +01:00
sdhci-xenon.h mmc: sdhci-xenon: switch to device_* API 2020-12-11 10:08:37 +01:00
sdhci.c sdhci: stop poking into swiotlb internals 2021-02-20 10:13:19 -05:00
sdhci.h
sdhci_am654.c mmc: sdhci_am654: Add Support for TI's AM64 SoC 2021-02-01 11:54:45 +01:00
sdhci_f_sdh30.c
sdhci_f_sdh30.h
sdricoh_cs.c
sh_mmcif.c
sunxi-mmc.c mmc: sunxi-mmc: Ensure host is suspended during system sleep 2021-02-01 11:54:45 +01:00
tifm_sd.c mmc: tifm_sd: Use new tasklet API 2021-02-08 13:00:31 +01:00
tmio_mmc.c mmc: tmio: do not print real IOMEM pointer 2020-11-17 12:46:39 +01:00
tmio_mmc.h mmc: renesas_sdhi: Add a condition of cmd/data timeout for retune 2021-02-01 11:54:43 +01:00
tmio_mmc_core.c mmc: renesas_sdhi: Add a condition of cmd/data timeout for retune 2021-02-01 11:54:43 +01:00
toshsd.c
toshsd.h
uniphier-sd.c mmc: uniphier-sd: Use new tasklet API 2021-02-08 13:00:31 +01:00
usdhi6rol0.c mmc: usdhi6rol0: Fix a resource leak in the error handling path of the probe 2021-02-01 11:54:42 +01:00
ushc.c
via-sdmmc.c mmc: via-sdmmc: Use new tasklet API 2021-02-08 13:00:31 +01:00
vub300.c
wbsd.c mmc: wbsd: Use new tasklet API 2021-02-08 13:00:31 +01:00
wbsd.h
wmt-sdmmc.c