Commit e0cda54e authored by Anti Sullin's avatar Anti Sullin Committed by Pierre Ossman

bug in AT91 MCI suspend routines

This patch fixes a bug in AT91 mmc host driver, that enables the wakeup
from suspend on card detection pin even if the card detect pin is not
available (==0). If not card detection pin is defined, IRQ0 == FIQ gets
enabled and if some activity is present on that pin, the system gets a
FIQ request, that causes a crash.
Signed-off-by: default avatarAnti Sullin <anti.sullin@artecdesign.ee>
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@rfo.atmel.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent b67ac3f3
...@@ -941,7 +941,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev) ...@@ -941,7 +941,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
host = mmc_priv(mmc); host = mmc_priv(mmc);
if (host->present != -1) { if (host->board->det_pin) {
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
free_irq(host->board->det_pin, host); free_irq(host->board->det_pin, host);
cancel_delayed_work(&host->mmc->detect); cancel_delayed_work(&host->mmc->detect);
...@@ -972,7 +972,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -972,7 +972,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
struct at91mci_host *host = mmc_priv(mmc); struct at91mci_host *host = mmc_priv(mmc);
int ret = 0; int ret = 0;
if (device_may_wakeup(&pdev->dev)) if (host->board->det_pin && device_may_wakeup(&pdev->dev))
enable_irq_wake(host->board->det_pin); enable_irq_wake(host->board->det_pin);
if (mmc) if (mmc)
...@@ -987,7 +987,7 @@ static int at91_mci_resume(struct platform_device *pdev) ...@@ -987,7 +987,7 @@ static int at91_mci_resume(struct platform_device *pdev)
struct at91mci_host *host = mmc_priv(mmc); struct at91mci_host *host = mmc_priv(mmc);
int ret = 0; int ret = 0;
if (device_may_wakeup(&pdev->dev)) if (host->board->det_pin && device_may_wakeup(&pdev->dev))
disable_irq_wake(host->board->det_pin); disable_irq_wake(host->board->det_pin);
if (mmc) if (mmc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment