[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1560489970-30467-1-git-send-email-jjian.zhou@mediatek.com>
Date: Fri, 14 Jun 2019 13:26:09 +0800
From: Jjian Zhou <jjian.zhou@...iatek.com>
To: <ulf.hansson@...aro.org>, <chaotian.jing@...iatek.com>,
<matthias.bgg@...il.com>, <linux-mmc@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <yong.mao@...iatek.com>, <srv_heupstream@...iatek.com>,
jjian zhou <jjian.zhou@...iatek.com>
Subject: [PATCH 1/2] mmc: mediatek: fix SDIO IRQ interrupt handle flow
From: jjian zhou <jjian.zhou@...iatek.com>
SDIO IRQ is triggered by low level. It need disable SDIO IRQ
detected function. Otherwise the interrupt register can't be cleared.
It will process the interrupt more.
Signed-off-by: Jjian Zhou <jjian.zhou@...iatek.com>
Signed-off-by: Chaotian Jing <chaotian.jing@...iatek.com>
Signed-off-by: Yong Mao <yong.mao@...iatek.com>
---
drivers/mmc/host/mtk-sd.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index c518cc2..29992ae 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1389,10 +1389,12 @@ static void __msdc_enable_sdio_irq(struct mmc_host *mmc, int enb)
struct msdc_host *host = mmc_priv(mmc);
spin_lock_irqsave(&host->lock, flags);
- if (enb)
+ if (enb) {
sdr_set_bits(host->base + MSDC_INTEN, MSDC_INTEN_SDIOIRQ);
- else
+ sdr_set_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
+ } else {
sdr_clr_bits(host->base + MSDC_INTEN, MSDC_INTEN_SDIOIRQ);
+ }
spin_unlock_irqrestore(&host->lock, flags);
}
@@ -1422,6 +1424,8 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
spin_lock_irqsave(&host->lock, flags);
events = readl(host->base + MSDC_INT);
event_mask = readl(host->base + MSDC_INTEN);
+ if ((events & event_mask) & MSDC_INT_SDIOIRQ)
+ sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
/* clear interrupts */
writel(events & event_mask, host->base + MSDC_INT);
@@ -1572,10 +1576,7 @@ static void msdc_init_hw(struct msdc_host *host)
sdr_set_bits(host->base + SDC_CFG, SDC_CFG_SDIO);
/* Config SDIO device detect interrupt function */
- if (host->mmc->caps & MMC_CAP_SDIO_IRQ)
- sdr_set_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
- else
- sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
+ sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
/* Configure to default data timeout */
sdr_set_field(host->base + SDC_CFG, SDC_CFG_DTOC, 3);
--
1.9.1
Powered by blists - more mailing lists