]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mmc: rtsx: fix card poweroff bug
authorMicky Ching <micky_ching@realsil.com.cn>
Mon, 17 Feb 2014 08:45:46 +0000 (16:45 +0800)
committerChris Ball <chris@printf.net>
Sat, 22 Feb 2014 18:33:38 +0000 (13:33 -0500)
If the host driver removed while card in the slot, the host will not
power off card power correctly. This bug is produced because host
eject flag set before the last mmc_set_ios callback, we should set the
eject flag after power off.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
Signed-off-by: Chris Ball <chris@printf.net>
drivers/mmc/host/rtsx_pci_sdmmc.c

index c46feda07d56883b1b6e50cbb46338d73c82bcca..cc80e3119d1de248648413434070f04c78a69bd8 100644 (file)
@@ -1297,7 +1297,6 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
        pcr->slots[RTSX_SD_CARD].p_dev = NULL;
        pcr->slots[RTSX_SD_CARD].card_event = NULL;
        mmc = host->mmc;
-       host->eject = true;
 
        mutex_lock(&host->host_mutex);
        if (host->mrq) {
@@ -1315,6 +1314,8 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
        mutex_unlock(&host->host_mutex);
 
        mmc_remove_host(mmc);
+       host->eject = true;
+
        mmc_free_host(mmc);
 
        dev_dbg(&(pdev->dev),