]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: mediatek: fix race condition between msdc_request_timeout and irq
authorChaotian Jing <chaotian.jing@mediatek.com>
Fri, 18 Dec 2020 07:16:11 +0000 (15:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 15:34:30 +0000 (16:34 +0100)
commit6a0734c88395faa99f97f6bc398da8fd0267f661
tree39d95017c93864042dbb3f9059276fb5b05ab4ed
parente24109bf5fcb784e18b3e69f938fcd2dd195d07c
mmc: mediatek: fix race condition between msdc_request_timeout and irq

[ Upstream commit 0354ca6edd464a2cf332f390581977b8699ed081 ]

when get request SW timeout, if CMD/DAT xfer done irq coming right now,
then there is race between the msdc_request_timeout work and irq handler,
and the host->cmd and host->data may set to NULL in irq handler. also,
current flow ensure that only one path can go to msdc_request_done(), so
no need check the return value of cancel_delayed_work().

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Link: https://lore.kernel.org/r/20201218071611.12276-1-chaotian.jing@mediatek.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/mtk-sd.c