mmc: mtk-sd: Clear interrupts when cqe off/disable
authorWenbin Mei <wenbin.mei@mediatek.com>
Thu, 28 Jul 2022 08:00:48 +0000 (16:00 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 15 Aug 2022 14:24:48 +0000 (16:24 +0200)
commitcc5d1692600613e72f32af60e27330fe0c79f4fe
tree962105500ccd1190ac9d57e696f051bbdb30a37c
parentb886f54c300d31c109d2e4336b22922b64e7ba7d
mmc: mtk-sd: Clear interrupts when cqe off/disable

Currently we don't clear MSDC interrupts when cqe off/disable, which led
to the data complete interrupt will be reserved for the next command.
If the next command with data transfer after cqe off/disable, we process
the CMD ready interrupt and trigger DMA start for data, but the data
complete interrupt is already exists, then SW assume that the data transfer
is complete, SW will trigger DMA stop, but the data may not be transmitted
yet or is transmitting, so we may encounter the following error:
mtk-msdc 11230000.mmc: CMD bus busy detected.

Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
Fixes: 88bd652b3c74 ("mmc: mediatek: command queue support")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220728080048.21336-1-wenbin.mei@mediatek.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mtk-sd.c