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

Commit 68adcae2 authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

mmc: sdhci: Fix issues with msm 3.9 kernel



This patch fixes the following issues in sdhci driver
from msm 3.9 kernel -

1. gpio_get_value_cansleep() is used from atomic context
resulting in warning from gpio driver. Move it to non-atomic
context.

2. Move sdhci_enable_preset_value() in set_ios callback after
clocks are enabled otherwise it would result in access to SDHCI
registers if clocks are disabled due to clock gating or suspend.

Change-Id: I231aa6e5c02669cf1aa3f21764642fa7da9a01ff
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflict]
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fix trivial merge conflict]
Signed-off-by: default avatarXiaonian Wang <xiaonian@codeaurora.org>
parent 1f52eaa6
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1579,8 +1579,22 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
		return;
	}

	/* Firstly check card presence */
	/*
	 * Firstly check card presence from cd-gpio.  The return could
	 * be one of the following possibilities:
	 *     negative: cd-gpio is not available
	 *     zero: cd-gpio is used, and card is removed
	 *     one: cd-gpio is used, and card is present
	 */
	present = mmc->ops->get_cd(mmc);
	if (present < 0) {
		/* If polling, assume that the card is always present. */
		if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
			present = 1;
		else
			present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
					SDHCI_CARD_PRESENT;
	}

	spin_lock_irqsave(&host->lock, flags);