|
@@ -1351,6 +1351,8 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
|
|
|
|
|
sdhci_runtime_pm_get(host);
|
|
sdhci_runtime_pm_get(host);
|
|
|
|
|
|
|
|
+ present = mmc_gpio_get_cd(host->mmc);
|
|
|
|
+
|
|
spin_lock_irqsave(&host->lock, flags);
|
|
spin_lock_irqsave(&host->lock, flags);
|
|
|
|
|
|
WARN_ON(host->mrq != NULL);
|
|
WARN_ON(host->mrq != NULL);
|
|
@@ -1379,7 +1381,6 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
|
* zero: cd-gpio is used, and card is removed
|
|
* zero: cd-gpio is used, and card is removed
|
|
* one: cd-gpio is used, and card is present
|
|
* one: cd-gpio is used, and card is present
|
|
*/
|
|
*/
|
|
- present = mmc_gpio_get_cd(host->mmc);
|
|
|
|
if (present < 0) {
|
|
if (present < 0) {
|
|
/* If polling, assume that the card is always present. */
|
|
/* If polling, assume that the card is always present. */
|
|
if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
|
|
if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
|
|
@@ -2126,15 +2127,18 @@ static void sdhci_card_event(struct mmc_host *mmc)
|
|
{
|
|
{
|
|
struct sdhci_host *host = mmc_priv(mmc);
|
|
struct sdhci_host *host = mmc_priv(mmc);
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
+ int present;
|
|
|
|
|
|
/* First check if client has provided their own card event */
|
|
/* First check if client has provided their own card event */
|
|
if (host->ops->card_event)
|
|
if (host->ops->card_event)
|
|
host->ops->card_event(host);
|
|
host->ops->card_event(host);
|
|
|
|
|
|
|
|
+ present = sdhci_do_get_cd(host);
|
|
|
|
+
|
|
spin_lock_irqsave(&host->lock, flags);
|
|
spin_lock_irqsave(&host->lock, flags);
|
|
|
|
|
|
/* Check host->mrq first in case we are runtime suspended */
|
|
/* Check host->mrq first in case we are runtime suspended */
|
|
- if (host->mrq && !sdhci_do_get_cd(host)) {
|
|
|
|
|
|
+ if (host->mrq && !present) {
|
|
pr_err("%s: Card removed during transfer!\n",
|
|
pr_err("%s: Card removed during transfer!\n",
|
|
mmc_hostname(host->mmc));
|
|
mmc_hostname(host->mmc));
|
|
pr_err("%s: Resetting controller.\n",
|
|
pr_err("%s: Resetting controller.\n",
|