diff options
author | Yuvaraj CD <yuvaraj.cd@gmail.com> | 2012-10-08 04:59:51 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-11-07 14:55:30 -0500 |
commit | 2da1d7f2948900cd50d38643db39f790edb3cc96 (patch) | |
tree | 361b697b0f83fa74cf16741359a8d234cfb50116 | |
parent | 63ef5d8c28b2a944f104d854254941e7375c85a3 (diff) |
mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
As mmc_start_host is getting called before enabling the dw_mmc controller
interrupt, there is a problem of missing the SDMMC_INT_CMD_DONE for the
very first command sent by the sdio_reset.
This problem occurs only when we disable MMC debugging i.e, MMC_DEBUG=n.
This patch enables the dw_mmc controller interrupt before mmc_start_host.
Signed-off-by: Yuvaraj CD <yuvaraj.cd@samsung.com>
Reviewed-by: Girish K S <girish.shivananjappa@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 250aa1836591..4b2bedc887ba 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -2228,6 +2228,21 @@ int dw_mci_probe(struct dw_mci *host) | |||
2228 | else | 2228 | else |
2229 | host->num_slots = ((mci_readl(host, HCON) >> 1) & 0x1F) + 1; | 2229 | host->num_slots = ((mci_readl(host, HCON) >> 1) & 0x1F) + 1; |
2230 | 2230 | ||
2231 | /* | ||
2232 | * Enable interrupts for command done, data over, data empty, card det, | ||
2233 | * receive ready and error such as transmit, receive timeout, crc error | ||
2234 | */ | ||
2235 | mci_writel(host, RINTSTS, 0xFFFFFFFF); | ||
2236 | mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER | | ||
2237 | SDMMC_INT_TXDR | SDMMC_INT_RXDR | | ||
2238 | DW_MCI_ERROR_FLAGS | SDMMC_INT_CD); | ||
2239 | mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */ | ||
2240 | |||
2241 | dev_info(host->dev, "DW MMC controller at irq %d, " | ||
2242 | "%d bit host data width, " | ||
2243 | "%u deep fifo\n", | ||
2244 | host->irq, width, fifo_size); | ||
2245 | |||
2231 | /* We need at least one slot to succeed */ | 2246 | /* We need at least one slot to succeed */ |
2232 | for (i = 0; i < host->num_slots; i++) { | 2247 | for (i = 0; i < host->num_slots; i++) { |
2233 | ret = dw_mci_init_slot(host, i); | 2248 | ret = dw_mci_init_slot(host, i); |
@@ -2257,20 +2272,6 @@ int dw_mci_probe(struct dw_mci *host) | |||
2257 | else | 2272 | else |
2258 | host->data_offset = DATA_240A_OFFSET; | 2273 | host->data_offset = DATA_240A_OFFSET; |
2259 | 2274 | ||
2260 | /* | ||
2261 | * Enable interrupts for command done, data over, data empty, card det, | ||
2262 | * receive ready and error such as transmit, receive timeout, crc error | ||
2263 | */ | ||
2264 | mci_writel(host, RINTSTS, 0xFFFFFFFF); | ||
2265 | mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER | | ||
2266 | SDMMC_INT_TXDR | SDMMC_INT_RXDR | | ||
2267 | DW_MCI_ERROR_FLAGS | SDMMC_INT_CD); | ||
2268 | mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); /* Enable mci interrupt */ | ||
2269 | |||
2270 | dev_info(host->dev, "DW MMC controller at irq %d, " | ||
2271 | "%d bit host data width, " | ||
2272 | "%u deep fifo\n", | ||
2273 | host->irq, width, fifo_size); | ||
2274 | if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO) | 2275 | if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO) |
2275 | dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n"); | 2276 | dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n"); |
2276 | 2277 | ||