kernel_samsung_a53x/drivers/mmc/host
Wolfram Sang d1e48df66e mmc: tmio: avoid concurrent runs of mmc_request_done()
[ Upstream commit e8d1b41e69d72c62865bebe8f441163ec00b3d44 ]

With the to-be-fixed commit, the reset_work handler cleared 'host->mrq'
outside of the spinlock protected critical section. That leaves a small
race window during execution of 'tmio_mmc_reset()' where the done_work
handler could grab a pointer to the now invalid 'host->mrq'. Both would
use it to call mmc_request_done() causing problems (see link below).

However, 'host->mrq' cannot simply be cleared earlier inside the
critical section. That would allow new mrqs to come in asynchronously
while the actual reset of the controller still needs to be done. So,
like 'tmio_mmc_set_ios()', an ERR_PTR is used to prevent new mrqs from
coming in but still avoiding concurrency between work handlers.

Reported-by: Dirk Behme <dirk.behme@de.bosch.com>
Closes: https://lore.kernel.org/all/20240220061356.3001761-1-dirk.behme@de.bosch.com/
Fixes: df3ef2d3c92c ("mmc: protect the tmio_mmc driver against a theoretical race")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>
Cc: stable@vger.kernel.org # 3.0+
Link: https://lore.kernel.org/r/20240305104423.3177-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 09:22:17 +01:00
..
alcor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
android-goldfish.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atmel-mci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
au1xmmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm2835.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium-octeon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium-thunderx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cb710-mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cb710-mmc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cqhci-core.c mmc: cqhci: Fix task clearing in CQE error recovery 2024-11-18 12:11:16 +01:00
cqhci-crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cqhci-crypto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cqhci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
davinci_mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-bluefield.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-exynos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-exynos.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-hi3798cv200.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-k3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-pltfm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-pltfm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-rockchip.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-zx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc-zx.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dw_mmc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jz4740_mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig mmc: sdhci_omap: Fix TI SoC dependencies 2024-11-18 12:12:43 +01:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson-gx-mmc.c mmc: meson-gx: Remove setting of CMD_CFG_ERROR 2024-11-18 11:43:25 +01:00
meson-mx-sdhc-clkc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson-mx-sdhc-mmc.c mmc: meson-mx-sdhc: Fix initialization frozen issue 2024-11-18 12:12:08 +01:00
meson-mx-sdhc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson-mx-sdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc-sec-feature.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc-sec-feature.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc-sec-sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc-sec-sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc_hsq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc_hsq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmc_spi.c mmc: mmc_spi: remove custom DMA mapped buffers 2024-11-18 12:12:58 +01:00
mmci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmci_qcom_dml.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmci_stm32_sdmmc.c mmc: mmci: stm32: fix DMA API overlapping mappings warning 2024-11-18 23:19:34 +01:00
moxart-mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtk-sd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mvsdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mvsdio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxcmmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxs-mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
of_mmc_spi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap_hsmmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
owl-mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxamci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxamci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
renesas_sdhi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
renesas_sdhi_core.c mmc: renesas_sdhi: use custom mask for TMIO_MASK_ALL 2024-11-18 10:58:28 +01:00
renesas_sdhi_internal_dmac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
renesas_sdhi_sys_dmac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rtsx_pci_sdmmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rtsx_usb_sdmmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3cmci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3cmci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-acpi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-bcm-kona.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-brcmstb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-cadence.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-cns3xxx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-cqhci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-dove.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-esdhc-imx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-esdhc-mcf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-esdhc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-iproc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-milbeaut.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-msm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-arasan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-aspeed.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-at91.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-dwcmshc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-esdhc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-hlwd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-of-sparx5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-omap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci-arasan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci-data.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci-dwc-mshc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci-gli.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci-o2micro.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pic32.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pltfm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pltfm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pxav2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-pxav3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-s3c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-sirf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-spear.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-sprd.c mmc: sdhci-sprd: Fix eMMC init failure after hw reset 2024-11-18 12:12:08 +01:00
sdhci-st.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-tegra.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-xenon-phy.c mmc: sdhci-xenon: fix PHY init clock stability 2024-11-18 23:18:29 +01:00
sdhci-xenon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci-xenon.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci_am654.c mmc: sdhci_am654: fix start loop index for TAP value parsing 2024-11-18 11:43:22 +01:00
sdhci_f_sdh30.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdhci_f_sdh30.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdricoh_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh_mmcif.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxi-mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tifm_sd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tmio_mmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tmio_mmc.h mmc: renesas_sdhi: use custom mask for TMIO_MASK_ALL 2024-11-18 10:58:28 +01:00
tmio_mmc_core.c mmc: tmio: avoid concurrent runs of mmc_request_done() 2024-11-19 09:22:17 +01:00
toshsd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
toshsd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uniphier-sd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
usdhi6rol0.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ushc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
via-sdmmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vub300.c mmc: vub300: fix an error code 2024-11-18 11:43:22 +01:00
wbsd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wbsd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wmt-sdmmc.c mmc: wmt-sdmmc: remove an incorrect release_mem_region() call in the .remove function 2024-11-19 08:44:48 +01:00