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

Commit 23dd7f88 authored by Sujit Reddy Thumma's avatar Sujit Reddy Thumma Committed by Xiaonian Wang
Browse files

mmc: sdhci: clear interrupt status during controller reset



In some cases, it is possible that the hardware might trigger
an interrupt just about the same time the software tries to
reset the controller. In such case, the hardware interrupt will
be handled after the current thread release spin lock. This leads
to spurious interrupt handling after the completion of reset.

Change-Id: I75211adee1179b0636a918f5ceb68a072ad02a6c
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
parent 598a4d46
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -240,6 +240,10 @@ void sdhci_reset(struct sdhci_host *host, u8 mask)
	    (mask & SDHCI_RESET_ALL))
		host->ops->check_power_status(host, REQ_BUS_OFF);

	/* clear pending normal/error interrupt status */
	sdhci_writel(host, sdhci_readl(host, SDHCI_INT_STATUS),
			SDHCI_INT_STATUS);

	/* hw clears the bit when it's done */
	while (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) {
		if (timeout == 0) {