Patch "mmc: mtk-sd: Clear interrupts when cqe off/disable" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mmc: mtk-sd: Clear interrupts when cqe off/disable

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mmc-mtk-sd-clear-interrupts-when-cqe-off-disable.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 52c9a3cf6ec7f4361c2adc2cd8ceaeabe1dd4526
Author: Wenbin Mei <wenbin.mei@xxxxxxxxxxxx>
Date:   Thu Jul 28 16:00:48 2022 +0800

    mmc: mtk-sd: Clear interrupts when cqe off/disable
    
    [ Upstream commit cc5d1692600613e72f32af60e27330fe0c79f4fe ]
    
    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@xxxxxxxxxxxx>
    Fixes: 88bd652b3c74 ("mmc: mediatek: command queue support")
    Cc: stable@xxxxxxxxxxxxxxx
    Link: https://lore.kernel.org/r/20220728080048.21336-1-wenbin.mei@xxxxxxxxxxxx
    Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index f5c965da95013..d71c113f428f6 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2293,6 +2293,9 @@ static void msdc_cqe_disable(struct mmc_host *mmc, bool recovery)
 	/* disable busy check */
 	sdr_clr_bits(host->base + MSDC_PATCH_BIT1, MSDC_PB1_BUSY_CHECK_SEL);
 
+	val = readl(host->base + MSDC_INT);
+	writel(val, host->base + MSDC_INT);
+
 	if (recovery) {
 		sdr_set_field(host->base + MSDC_DMA_CTRL,
 			      MSDC_DMA_CTRL_STOP, 1);
@@ -2693,11 +2696,14 @@ static int __maybe_unused msdc_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	int ret;
+	u32 val;
 
 	if (mmc->caps2 & MMC_CAP2_CQE) {
 		ret = cqhci_suspend(mmc);
 		if (ret)
 			return ret;
+		val = readl(((struct msdc_host *)mmc_priv(mmc))->base + MSDC_INT);
+		writel(val, ((struct msdc_host *)mmc_priv(mmc))->base + MSDC_INT);
 	}
 
 	return pm_runtime_force_suspend(dev);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux