Skip to content

Commit

Permalink
mmc: rtsx: fix card poweroff bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Micky Ching authored and Chris Ball committed Feb 22, 2014
1 parent 9107ebb commit 640e09b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mmc/host/rtsx_pci_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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),
Expand Down

0 comments on commit 640e09b

Please sign in to comment.