mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 04:03:58 +08:00
mmc: sdhci: call sdhci_init() before request irq
sdhci_init() will clear all irqs and set the needed irqs. So logically sdhci_init() should be called before request irq. If not, some irqs may be triggled and handled wrongly. Take the following into consideration, after request irq, if SDIO card interrupt enabled, a sd card in the sd slot will trigger a mass of interrupt(SDHCI_INT_CARD_INT), because at this time, the vmmc-regulator still not restore, no voltage supply for the sd card, so the pin of data0~data3 change and keep low, interrupt(SDHCI_INT_CARD_INT) will rise up ceaselessly. Due to we already reguest irq, system will be busy in handling this endless irq, can't response to other event. So we should call sdhci_init() before request irq in sd resume. Signed-off-by: Haibo Chen <haibo.chen@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
28804293b9
commit
14a7b41643
@ -2716,17 +2716,6 @@ int sdhci_resume_host(struct sdhci_host *host)
|
||||
host->ops->enable_dma(host);
|
||||
}
|
||||
|
||||
if (!device_may_wakeup(mmc_dev(host->mmc))) {
|
||||
ret = request_threaded_irq(host->irq, sdhci_irq,
|
||||
sdhci_thread_irq, IRQF_SHARED,
|
||||
mmc_hostname(host->mmc), host);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
sdhci_disable_irq_wakeups(host);
|
||||
disable_irq_wake(host->irq);
|
||||
}
|
||||
|
||||
if ((host->mmc->pm_flags & MMC_PM_KEEP_POWER) &&
|
||||
(host->quirks2 & SDHCI_QUIRK2_HOST_OFF_CARD_ON)) {
|
||||
/* Card keeps power but host controller does not */
|
||||
@ -2739,6 +2728,17 @@ int sdhci_resume_host(struct sdhci_host *host)
|
||||
mmiowb();
|
||||
}
|
||||
|
||||
if (!device_may_wakeup(mmc_dev(host->mmc))) {
|
||||
ret = request_threaded_irq(host->irq, sdhci_irq,
|
||||
sdhci_thread_irq, IRQF_SHARED,
|
||||
mmc_hostname(host->mmc), host);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
sdhci_disable_irq_wakeups(host);
|
||||
disable_irq_wake(host->irq);
|
||||
}
|
||||
|
||||
sdhci_enable_card_detection(host);
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user