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)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Feb 2021 10:54:43 +0000 (11:54 +0100)
commit0354ca6edd464a2cf332f390581977b8699ed081
tree2afca77177f348b5458f106e53a4c4a9c9bdc0d9
parent69e7d76afdb54243df957351804c0f1afca46d0f
mmc: mediatek: fix race condition between msdc_request_timeout and irq

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>
drivers/mmc/host/mtk-sd.c