]> git.itanic.dy.fi Git - linux-stable/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:07:20 +0000 (16:07 +0100)
commitfaac963f986cde5ada0dec1baaf50837415fba49
tree741a4a6f65a4fa99204a5d17efcc99199109a8cd
parent2d96044d2271f423a9ad009073a773debf52e793
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