aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2013-03-12 06:43:54 -0400
committerChris Ball <cjb@laptop.org>2013-03-22 12:42:53 -0400
commit63008768d2663723b6acea2f8739e1c8460da726 (patch)
tree4138c18052ce719ee18a2bf17221a72a6adb6378
parente6f34e2fd3a7c6bc4893c08583d55599ac15eb9d (diff)
mmc: dw_mmc: move host->data_offset init earlier
host->data_offset is initialised at the end of the probe function depending on the VERID register, and is used for PIO operations. Move this initialisation earlier, before IRQs or slots are initialised, to be sure that PIO won't occur prior to host->data_offset being initialised. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/dw_mmc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 6891fd131b0a..7716a08675fc 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2293,6 +2293,18 @@ int dw_mci_probe(struct dw_mci *host)
2293 mci_writel(host, CLKENA, 0); 2293 mci_writel(host, CLKENA, 0);
2294 mci_writel(host, CLKSRC, 0); 2294 mci_writel(host, CLKSRC, 0);
2295 2295
2296 /*
2297 * In 2.40a spec, Data offset is changed.
2298 * Need to check the version-id and set data-offset for DATA register.
2299 */
2300 host->verid = SDMMC_GET_VERID(mci_readl(host, VERID));
2301 dev_info(host->dev, "Version ID is %04x\n", host->verid);
2302
2303 if (host->verid < DW_MMC_240A)
2304 host->data_offset = DATA_OFFSET;
2305 else
2306 host->data_offset = DATA_240A_OFFSET;
2307
2296 tasklet_init(&host->tasklet, dw_mci_tasklet_func, (unsigned long)host); 2308 tasklet_init(&host->tasklet, dw_mci_tasklet_func, (unsigned long)host);
2297 host->card_workqueue = alloc_workqueue("dw-mci-card", 2309 host->card_workqueue = alloc_workqueue("dw-mci-card",
2298 WQ_MEM_RECLAIM | WQ_NON_REENTRANT, 1); 2310 WQ_MEM_RECLAIM | WQ_NON_REENTRANT, 1);
@@ -2341,18 +2353,6 @@ int dw_mci_probe(struct dw_mci *host)
2341 goto err_workqueue; 2353 goto err_workqueue;
2342 } 2354 }
2343 2355
2344 /*
2345 * In 2.40a spec, Data offset is changed.
2346 * Need to check the version-id and set data-offset for DATA register.
2347 */
2348 host->verid = SDMMC_GET_VERID(mci_readl(host, VERID));
2349 dev_info(host->dev, "Version ID is %04x\n", host->verid);
2350
2351 if (host->verid < DW_MMC_240A)
2352 host->data_offset = DATA_OFFSET;
2353 else
2354 host->data_offset = DATA_240A_OFFSET;
2355
2356 if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO) 2356 if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO)
2357 dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n"); 2357 dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n");
2358 2358