From: Ryan QIAN Date: Tue, 9 Oct 2012 00:58:41 +0000 (+0800) Subject: ENGR00220469 mmc: sdio: claim host on suspend and release on resuming X-Git-Tag: v3.0.35-fsl~387 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e459d131b6d4cfb393464831c8f34dda15e9be7b;p=karo-tx-linux.git ENGR00220469 mmc: sdio: claim host on suspend and release on resuming issue: Since there's no sync mechanism between sdio bus suspending and sdio_irq_thread, it will cause that sdio_irq_thread still makes sdhc request even after sdio bus suspends. fix: On suspending sdio bus, claim host, so that: 1. mmc_sdio_suspend will wait for finishing of sdio_irq_thread. 2. sdio_irq_thread will be blocked even being scheduled. And release host on resuming. Acked-by: Aisheng DONG Signed-off-by: Ryan QIAN --- diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 16b7484917c7..cc3736bedb2b 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -638,6 +638,9 @@ static int mmc_sdio_suspend(struct mmc_host *host) mmc_release_host(host); } + if (!err) + mmc_claim_host(host); + return err; } @@ -648,9 +651,6 @@ static int mmc_sdio_resume(struct mmc_host *host) BUG_ON(!host); BUG_ON(!host->card); - /* Basic card reinitialization. */ - mmc_claim_host(host); - /* No need to reinitialize powered-resumed nonremovable cards */ if (mmc_card_is_removable(host) && !mmc_card_keep_power(host)) err = mmc_sdio_init_card(host, host->ocr, host->card,