@@ -1862,6 +1862,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32
sdhci_runtime_pm_get(host);
disable_irq(host->irq);
+ sdhci_disable_card_detection(host);
spin_lock(&host->lock);
ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
@@ -1883,6 +1884,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32
ctrl |= SDHCI_CTRL_EXEC_TUNING;
else {
spin_unlock(&host->lock);
+ sdhci_enable_card_detection(host);
enable_irq(host->irq);
sdhci_runtime_pm_put(host);
return 0;
@@ -1890,6 +1892,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32
if (host->ops->platform_execute_tuning) {
spin_unlock(&host->lock);
+ sdhci_enable_card_detection(host);
enable_irq(host->irq);
err = host->ops->platform_execute_tuning(host, opcode);
sdhci_runtime_pm_put(host);
@@ -2047,6 +2050,7 @@ out:
sdhci_clear_set_irqs(host, SDHCI_INT_DATA_AVAIL, ier);
spin_unlock(&host->lock);
+ sdhci_enable_card_detection(host);
enable_irq(host->irq);
sdhci_runtime_pm_put(host);