On Fri, 21 Jan 2011, zhangfei gao wrote:

> >From b7be39e0bbac3950057078ac66900ebc0871f77e Mon Sep 17 00:00:00 2001
> From: Zhangfei Gao <zhangfei....@marvell.com>
> Date: Fri, 21 Jan 2011 18:02:47 -0500
> Subject: [PATCH] mmc: clear all interrupt in suspend before free_irq
> 
>       When debugging wifi host sleep, race condition about
> SDHCI_INT_CARD_INT happens.
>       Host free_irq in suspend and request_irq when resume back.
>       However SDHCI_INT_CARD_INT is not cleared, so interrupt will
> immediately happen after request_irq.
>       mmc_signal_sdio_irq will be called and wakeup sdio_irq_thread.
>       As a result irq_handler in sdio driver is called even before host 
> resume back.
> 
>       The correct case is mmc_sdio_resume calls mmc_signal_sdio_irq to
> wakeup sdio_irq_thread
> 
> Signed-off-by: Zhangfei Gao <zhangfei....@marvell.com>

That makes sense, as long as the masking of interrupts doesn't prevent 
a SDIO card interrupt from waking up the host system.


> ---
>  drivers/mmc/host/sdhci.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index aacd78c..97074ae 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1707,6 +1707,7 @@ int sdhci_suspend_host(struct sdhci_host *host,
> pm_message_t state)
>       ret = mmc_suspend_host(host->mmc);
>       if (ret)
>               return ret;
> +     sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK, 0);
> 
>       free_irq(host->irq, host);
> 
> -- 
> 1.7.0.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to