Skip to content

Commit

Permalink
mmc: dw_mmc: insmod followed by rmmod will hung for eMMC
Browse files Browse the repository at this point in the history
Remove module of dw_mmc driver will hung for eMMC devices if we follow the
steps which are listed below,
	insmod dw_mmc.ko
	insmod dw_mmc-pci.ko
	rmmod dw_mmc-pci.ko

The root cause for this issue is, dw_mci_remove() will disable all the
interrupts by programming 0x0 to INTMASK register then it will call
dw_mci_cleanup_slot(). But dw_mci_cleanup_slot() is issuing CMD6 to
disable the eMMC boot partition and it is waiting for Command Complete
interrupt. Since INTMASK was already cleared by dw_mci_remove(), Command
Complete interrupt is not reaching the system. This leads to process hung.

Signed-off-by: Prabu Thangamuthu <prabu.t@synopsys.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Prabu Thangamuthu authored and Ulf Hansson committed Jun 12, 2015
1 parent 5fd26c7 commit 048fd7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2926,15 +2926,15 @@ void dw_mci_remove(struct dw_mci *host)
{
int i;

mci_writel(host, RINTSTS, 0xFFFFFFFF);
mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */

for (i = 0; i < host->num_slots; i++) {
dev_dbg(host->dev, "remove slot %d\n", i);
if (host->slot[i])
dw_mci_cleanup_slot(host->slot[i], i);
}

mci_writel(host, RINTSTS, 0xFFFFFFFF);
mci_writel(host, INTMASK, 0); /* disable all mmc interrupt first */

/* disable clock to CIU */
mci_writel(host, CLKENA, 0);
mci_writel(host, CLKSRC, 0);
Expand Down

0 comments on commit 048fd7e

Please sign in to comment.