|
@@ -1857,12 +1857,12 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
|
|
|
unsigned long timeout;
|
|
|
int err = 0;
|
|
|
bool requires_tuning_nonuhs = false;
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
host = mmc_priv(mmc);
|
|
|
|
|
|
sdhci_runtime_pm_get(host);
|
|
|
- disable_irq(host->irq);
|
|
|
- spin_lock(&host->lock);
|
|
|
+ spin_lock_irqsave(&host->lock, flags);
|
|
|
|
|
|
ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
|
|
|
|
|
@@ -1882,15 +1882,13 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
|
|
|
requires_tuning_nonuhs)
|
|
|
ctrl |= SDHCI_CTRL_EXEC_TUNING;
|
|
|
else {
|
|
|
- spin_unlock(&host->lock);
|
|
|
- enable_irq(host->irq);
|
|
|
+ spin_unlock_irqrestore(&host->lock, flags);
|
|
|
sdhci_runtime_pm_put(host);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
if (host->ops->platform_execute_tuning) {
|
|
|
- spin_unlock(&host->lock);
|
|
|
- enable_irq(host->irq);
|
|
|
+ spin_unlock_irqrestore(&host->lock, flags);
|
|
|
err = host->ops->platform_execute_tuning(host, opcode);
|
|
|
sdhci_runtime_pm_put(host);
|
|
|
return err;
|
|
@@ -1963,15 +1961,12 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
|
|
|
host->cmd = NULL;
|
|
|
host->mrq = NULL;
|
|
|
|
|
|
- spin_unlock(&host->lock);
|
|
|
- enable_irq(host->irq);
|
|
|
-
|
|
|
+ spin_unlock_irqrestore(&host->lock, flags);
|
|
|
/* Wait for Buffer Read Ready interrupt */
|
|
|
wait_event_interruptible_timeout(host->buf_ready_int,
|
|
|
(host->tuning_done == 1),
|
|
|
msecs_to_jiffies(50));
|
|
|
- disable_irq(host->irq);
|
|
|
- spin_lock(&host->lock);
|
|
|
+ spin_lock_irqsave(&host->lock, flags);
|
|
|
|
|
|
if (!host->tuning_done) {
|
|
|
pr_info(DRIVER_NAME ": Timeout waiting for "
|
|
@@ -2046,8 +2041,7 @@ out:
|
|
|
err = 0;
|
|
|
|
|
|
sdhci_clear_set_irqs(host, SDHCI_INT_DATA_AVAIL, ier);
|
|
|
- spin_unlock(&host->lock);
|
|
|
- enable_irq(host->irq);
|
|
|
+ spin_unlock_irqrestore(&host->lock, flags);
|
|
|
sdhci_runtime_pm_put(host);
|
|
|
|
|
|
return err;
|