aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9ddef4763541..9a79fc4b60ca 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -675,12 +675,12 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
675 return 0xE; 675 return 0xE;
676 676
677 /* Unspecified timeout, assume max */ 677 /* Unspecified timeout, assume max */
678 if (!data && !cmd->cmd_timeout_ms) 678 if (!data && !cmd->busy_timeout)
679 return 0xE; 679 return 0xE;
680 680
681 /* timeout in us */ 681 /* timeout in us */
682 if (!data) 682 if (!data)
683 target_timeout = cmd->cmd_timeout_ms * 1000; 683 target_timeout = cmd->busy_timeout * 1000;
684 else { 684 else {
685 target_timeout = data->timeout_ns / 1000; 685 target_timeout = data->timeout_ns / 1000;
686 if (host->clock) 686 if (host->clock)
@@ -1019,8 +1019,8 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
1019 } 1019 }
1020 1020
1021 timeout = jiffies; 1021 timeout = jiffies;
1022 if (!cmd->data && cmd->cmd_timeout_ms > 9000) 1022 if (!cmd->data && cmd->busy_timeout > 9000)
1023 timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ; 1023 timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ;
1024 else 1024 else
1025 timeout += 10 * HZ; 1025 timeout += 10 * HZ;
1026 mod_timer(&host->timer, timeout); 1026 mod_timer(&host->timer, timeout);
@@ -2026,12 +2026,11 @@ out:
2026 host->tuning_count * HZ); 2026 host->tuning_count * HZ);
2027 /* Tuning mode 1 limits the maximum data length to 4MB */ 2027 /* Tuning mode 1 limits the maximum data length to 4MB */
2028 mmc->max_blk_count = (4 * 1024 * 1024) / mmc->max_blk_size; 2028 mmc->max_blk_count = (4 * 1024 * 1024) / mmc->max_blk_size;
2029 } else { 2029 } else if (host->flags & SDHCI_USING_RETUNING_TIMER) {
2030 host->flags &= ~SDHCI_NEEDS_RETUNING; 2030 host->flags &= ~SDHCI_NEEDS_RETUNING;
2031 /* Reload the new initial value for timer */ 2031 /* Reload the new initial value for timer */
2032 if (host->tuning_mode == SDHCI_TUNING_MODE_1) 2032 mod_timer(&host->tuning_timer, jiffies +
2033 mod_timer(&host->tuning_timer, jiffies + 2033 host->tuning_count * HZ);
2034 host->tuning_count * HZ);
2035 } 2034 }
2036 2035
2037 /* 2036 /*
@@ -2434,9 +2433,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
2434 2433
2435 if (host->runtime_suspended) { 2434 if (host->runtime_suspended) {
2436 spin_unlock(&host->lock); 2435 spin_unlock(&host->lock);
2437 pr_warning("%s: got irq while runtime suspended\n", 2436 return IRQ_NONE;
2438 mmc_hostname(host->mmc));
2439 return IRQ_HANDLED;
2440 } 2437 }
2441 2438
2442 intmask = sdhci_readl(host, SDHCI_INT_STATUS); 2439 intmask = sdhci_readl(host, SDHCI_INT_STATUS);
@@ -2941,7 +2938,7 @@ int sdhci_add_host(struct sdhci_host *host)
2941 if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) 2938 if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
2942 host->timeout_clk = mmc->f_max / 1000; 2939 host->timeout_clk = mmc->f_max / 1000;
2943 2940
2944 mmc->max_discard_to = (1 << 27) / host->timeout_clk; 2941 mmc->max_busy_timeout = (1 << 27) / host->timeout_clk;
2945 2942
2946 mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; 2943 mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
2947 2944
@@ -3020,7 +3017,8 @@ int sdhci_add_host(struct sdhci_host *host)
3020 } else if (caps[1] & SDHCI_SUPPORT_SDR50) 3017 } else if (caps[1] & SDHCI_SUPPORT_SDR50)
3021 mmc->caps |= MMC_CAP_UHS_SDR50; 3018 mmc->caps |= MMC_CAP_UHS_SDR50;
3022 3019
3023 if (caps[1] & SDHCI_SUPPORT_DDR50) 3020 if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
3021 !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
3024 mmc->caps |= MMC_CAP_UHS_DDR50; 3022 mmc->caps |= MMC_CAP_UHS_DDR50;
3025 3023
3026 /* Does the host need tuning for SDR50? */ 3024 /* Does the host need tuning for SDR50? */