Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 278b8e83 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan
Browse files

mmc: sdhci: Clear error interrupt status in CMDQ mode



Any CMD/DAT errors raised using the error interrupt status in
CMDQ mode also needs to be cleared. If this is not cleared,
any error in supported CMDQ CMD's like CMD 44/45/46/47/48 will
cause an interrupt storm.

Change-Id: Ie725bbf1c859a2dc91b64274e05e71328dfeb1b2
Signed-off-by: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent c025b09c
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -3074,22 +3074,30 @@ static int sdhci_get_data_err(u32 intmask)
	return 0;
}

static irqreturn_t sdhci_cmdq_irq(struct mmc_host *mmc, u32 intmask)
static irqreturn_t sdhci_cmdq_irq(struct sdhci_host *host, u32 intmask)
{
	int err = 0;
	u32 mask = 0;

	if (intmask & SDHCI_INT_CMD_MASK)
		err = sdhci_get_cmd_err(intmask);
	else if (intmask & SDHCI_INT_DATA_MASK)
		err = sdhci_get_data_err(intmask);

	return cmdq_irq(mmc, err);
	if (err) {
		/* Clear the error interrupts */
		mask = intmask & SDHCI_INT_ERROR_MASK;
		sdhci_writel(host, mask, SDHCI_INT_STATUS);
	}

	return cmdq_irq(host->mmc, err);
}

#else
static irqreturn_t sdhci_cmdq_irq(struct mmc_host *mmc, u32 intmask)
static irqreturn_t sdhci_cmdq_irq(struct sdhci_host *host, u32 intmask)
{
	pr_err("%s: rxd cmdq-irq when disabled !!!!\n", mmc_hostname(mmc));
	pr_err("%s: Received cmdq-irq when disabled !!!!\n",
		mmc_hostname(host->mmc));
	return IRQ_NONE;
}
#endif
@@ -3120,7 +3128,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
			pr_debug("*** %s: cmdq intr: 0x%08x\n",
					mmc_hostname(host->mmc),
					intmask);
			result = sdhci_cmdq_irq(host->mmc, intmask);
			result = sdhci_cmdq_irq(host, intmask);
			if (result == IRQ_HANDLED)
				goto out;
		}