aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/atmel-mci.c9
-rw-r--r--drivers/mmc/host/dw_mmc.c7
-rw-r--r--drivers/mmc/host/sh_mmcif.c2
3 files changed, 13 insertions, 5 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 03d7c7521d97..9a39e0b7e583 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1304,7 +1304,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1304 1304
1305 if (ios->clock) { 1305 if (ios->clock) {
1306 unsigned int clock_min = ~0U; 1306 unsigned int clock_min = ~0U;
1307 u32 clkdiv; 1307 int clkdiv;
1308 1308
1309 spin_lock_bh(&host->lock); 1309 spin_lock_bh(&host->lock);
1310 if (!host->mode_reg) { 1310 if (!host->mode_reg) {
@@ -1328,7 +1328,12 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1328 /* Calculate clock divider */ 1328 /* Calculate clock divider */
1329 if (host->caps.has_odd_clk_div) { 1329 if (host->caps.has_odd_clk_div) {
1330 clkdiv = DIV_ROUND_UP(host->bus_hz, clock_min) - 2; 1330 clkdiv = DIV_ROUND_UP(host->bus_hz, clock_min) - 2;
1331 if (clkdiv > 511) { 1331 if (clkdiv < 0) {
1332 dev_warn(&mmc->class_dev,
1333 "clock %u too fast; using %lu\n",
1334 clock_min, host->bus_hz / 2);
1335 clkdiv = 0;
1336 } else if (clkdiv > 511) {
1332 dev_warn(&mmc->class_dev, 1337 dev_warn(&mmc->class_dev,
1333 "clock %u too slow; using %lu\n", 1338 "clock %u too slow; using %lu\n",
1334 clock_min, host->bus_hz / (511 + 2)); 1339 clock_min, host->bus_hz / (511 + 2));
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 38b29265cc7c..5f5adafb253a 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -589,9 +589,11 @@ static int dw_mci_idmac_init(struct dw_mci *host)
589 host->ring_size = PAGE_SIZE / sizeof(struct idmac_desc); 589 host->ring_size = PAGE_SIZE / sizeof(struct idmac_desc);
590 590
591 /* Forward link the descriptor list */ 591 /* Forward link the descriptor list */
592 for (i = 0, p = host->sg_cpu; i < host->ring_size - 1; i++, p++) 592 for (i = 0, p = host->sg_cpu; i < host->ring_size - 1; i++, p++) {
593 p->des3 = cpu_to_le32(host->sg_dma + 593 p->des3 = cpu_to_le32(host->sg_dma +
594 (sizeof(struct idmac_desc) * (i + 1))); 594 (sizeof(struct idmac_desc) * (i + 1)));
595 p->des1 = 0;
596 }
595 597
596 /* Set the last descriptor as the end-of-ring descriptor */ 598 /* Set the last descriptor as the end-of-ring descriptor */
597 p->des3 = cpu_to_le32(host->sg_dma); 599 p->des3 = cpu_to_le32(host->sg_dma);
@@ -1300,7 +1302,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
1300 int gpio_cd = mmc_gpio_get_cd(mmc); 1302 int gpio_cd = mmc_gpio_get_cd(mmc);
1301 1303
1302 /* Use platform get_cd function, else try onboard card detect */ 1304 /* Use platform get_cd function, else try onboard card detect */
1303 if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) 1305 if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
1306 (mmc->caps & MMC_CAP_NONREMOVABLE))
1304 present = 1; 1307 present = 1;
1305 else if (!IS_ERR_VALUE(gpio_cd)) 1308 else if (!IS_ERR_VALUE(gpio_cd))
1306 present = gpio_cd; 1309 present = gpio_cd;
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 2b6ef6bd5d5f..7eff087cf515 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1408,7 +1408,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
1408 host = mmc_priv(mmc); 1408 host = mmc_priv(mmc);
1409 host->mmc = mmc; 1409 host->mmc = mmc;
1410 host->addr = reg; 1410 host->addr = reg;
1411 host->timeout = msecs_to_jiffies(1000); 1411 host->timeout = msecs_to_jiffies(10000);
1412 host->ccs_enable = !pd || !pd->ccs_unsupported; 1412 host->ccs_enable = !pd || !pd->ccs_unsupported;
1413 host->clk_ctrl2_enable = pd && pd->clk_ctrl2_present; 1413 host->clk_ctrl2_enable = pd && pd->clk_ctrl2_present;
1414 1414