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

Commit ac6de6d6 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

mmc: sdhci: remove incorrect spinlock release



sdhci_set_clock() may try to release spinlock even if it is not acquired.
Fix this by removing spin lock/unlock before usleep() as sdhci_set_clock()
is not getting called with spinlock held.

Change-Id: I4db5e818daf8c9e0f29b094120f0df3aa3eb073e
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 13ce0881
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1523,7 +1523,7 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
	sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);

	/* Wait max 20 ms */
	timeout = 20000;
	timeout = 20;
	while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
		& SDHCI_CLOCK_INT_STABLE)) {
		if (timeout == 0) {
@@ -1533,9 +1533,7 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
			return;
		}
		timeout--;
		spin_unlock_irq(&host->lock);
		usleep_range(900, 1100);
		spin_lock_irq(&host->lock);
	}

	clk |= SDHCI_CLOCK_CARD_EN;