aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2011-08-03 11:35:58 -0400
committerChris Ball <cjb@laptop.org>2011-08-13 14:50:27 -0400
commit83cbcd93a1be803ccda53e7acbdc9a937c8f6375 (patch)
treedbe47bb08608058d3d3bc0c530793cbad02e6e41 /drivers
parent4906baf080623b4971bdeeac0a9fec5b8885d3ac (diff)
mmc: Revert "mmc: sdhci: Fix SDHCI_QUIRK_TIMEOUT_USES_SDCLK"
This reverts commit 4b01681c7764, which introduced a new potential divide by zero in the process of fixing one. The subsequent commits attempt to fix the issue properly. Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 262985a1a952..11d031b8708c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -632,9 +632,6 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
632 target_timeout = data->timeout_ns / 1000 + 632 target_timeout = data->timeout_ns / 1000 +
633 data->timeout_clks / host->clock; 633 data->timeout_clks / host->clock;
634 634
635 if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
636 host->timeout_clk = host->clock / 1000;
637
638 /* 635 /*
639 * Figure out needed cycles. 636 * Figure out needed cycles.
640 * We do this in steps in order to fit inside a 32 bit int. 637 * We do this in steps in order to fit inside a 32 bit int.
@@ -645,7 +642,6 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
645 * => 642 * =>
646 * (1) / (2) > 2^6 643 * (1) / (2) > 2^6
647 */ 644 */
648 BUG_ON(!host->timeout_clk);
649 count = 0; 645 count = 0;
650 current_timeout = (1 << 13) * 1000 / host->timeout_clk; 646 current_timeout = (1 << 13) * 1000 / host->timeout_clk;
651 while (current_timeout < target_timeout) { 647 while (current_timeout < target_timeout) {
@@ -2474,6 +2470,9 @@ int sdhci_add_host(struct sdhci_host *host)
2474 if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) 2470 if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
2475 host->timeout_clk *= 1000; 2471 host->timeout_clk *= 1000;
2476 2472
2473 if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
2474 host->timeout_clk = host->clock / 1000;
2475
2477 /* 2476 /*
2478 * In case of Host Controller v3.00, find out whether clock 2477 * In case of Host Controller v3.00, find out whether clock
2479 * multiplier is supported. 2478 * multiplier is supported.