Thread (30 messages) 30 messages, 3 authors, 2013-12-17
STALE4586d

[PATCH 5/6] mmc: sdhci: calculate max_discard_to dynamically for SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK

From: Dong Aisheng <hidden>
Date: 2013-12-11 05:06:41
Also in: linux-mmc

On Wed, Dec 11, 2013 at 12:05 PM, Shawn Guo [off-list ref] wrote:
On Tue, Dec 10, 2013 at 08:56:07PM +0800, Dong Aisheng wrote:
quoted
 static inline void sdhci_update_clock(struct sdhci_host *host)
@@ -2939,10 +2952,12 @@ int sdhci_add_host(struct sdhci_host *host)
      if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
              host->timeout_clk = mmc->f_max / 1000;
Since max_discard_to calculation below will not happen for
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK case, does it still make sense to
keep the above code?
Right, i missed to remove it.
Will update in v2.
Or put it in the other way, if we keep the above code and do not make
the change below, will there be any problem besides the max_discard_to
initialization plays for nothing?

All in all, I'm just confused why we keep the above code and make the
change below at the same time.
THe max_discard_to should be dynamically updated for
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
when changing the clock, so we can remove above lines.

Regards
Dong Aisheng
Shawn
quoted
-     if (host->ops->get_max_timeout)
-             mmc->max_discard_to = host->ops->get_max_timeout(host);
-     else
-             mmc->max_discard_to = (1 << 27) / host->timeout_clk;
+     if (!(host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) {
+             if (host->ops->get_max_timeout)
+                     mmc->max_discard_to = host->ops->get_max_timeout(host);
+             else
+                     mmc->max_discard_to = (1 << 27) / host->timeout_clk;
+     }

      mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;

--
1.7.2.rc3

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help