mmc: mediatek: wait dma stop bit reset to 0
authorMengqi Zhang <mengqi.zhang@mediatek.com>
Thu, 9 Jun 2022 11:22:39 +0000 (19:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jun 2022 07:03:19 +0000 (09:03 +0200)
commitfe9ba4f29320c426ec1d3f2c171ef4078a6cd1a1
tree847a497eea5c27b8742c9a1e6ed68e2c70a81f3f
parent7df8c497214b32b5de70215ab7897e7844477aa5
mmc: mediatek: wait dma stop bit reset to 0

commit 89bcd9a64b849380ef57e3032b307574e48db524 upstream.

MediaTek IP requires that after dma stop, it need to wait this dma stop
bit auto-reset to 0. When bus is in high loading state, it will take a
while for the dma stop complete. If there is no waiting operation here,
when program runs to clear fifo and reset, bus will hang.

In addition, there should be no return in msdc_data_xfer_next() if
there is data need be transferred, because no matter what error occurs
here, it should continue to excute to the following mmc_request_done.
Otherwise the core layer may wait complete forever.

Signed-off-by: Mengqi Zhang <mengqi.zhang@mediatek.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220609112239.18911-1-mengqi.zhang@mediatek.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/mtk-sd.c