summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Konda <kkonda@codeaurora.org>2015-09-26 17:55:48 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:37 -0700
commitd2cd07bae2906121ab050ef345b26ae5f401f9ca (patch)
tree5167da1fe5745f870031e9b04792439527e4fae7
parent6d9a04f1b112e5afd57bafb1fb80e67778656844 (diff)
mmc: sdhci-msm: use max discard size supported for mmc queue
With newer mmc drivers, max_discard_to has been remvoed from the sdhci driver. So instead of incorrectly using max_busy_timeout for calculating max_discard to be used by mmc queue, use the mmc cap to indicate that the max discard should be used for msm sdhci driver. Change-Id: I424cd0a5ee9ffd7199be58a5a091984c5fcda52f Signed-off-by: Krishna Konda <kkonda@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci-msm.c2
-rw-r--r--drivers/mmc/host/sdhci.c4
-rw-r--r--drivers/mmc/host/sdhci.h12
3 files changed, 4 insertions, 14 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index cbfc473ca76f..a5e18e35b115 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -4032,7 +4032,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
host->quirks |= SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
host->quirks2 |= SDHCI_QUIRK2_ALWAYS_USE_BASE_CLOCK;
- host->quirks2 |= SDHCI_QUIRK2_USE_MAX_DISCARD_SIZE;
host->quirks2 |= SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD;
host->quirks2 |= SDHCI_QUIRK2_BROKEN_PRESET_VALUE;
host->quirks2 |= SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT;
@@ -4094,6 +4093,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
msm_host->mmc->caps2 |= MMC_CAP2_HS400_POST_TUNING;
msm_host->mmc->caps2 |= MMC_CAP2_CLK_SCALE;
msm_host->mmc->caps2 |= MMC_CAP2_SANITIZE;
+ msm_host->mmc->caps2 |= MMC_CAP2_MAX_DISCARD_SIZE;
if (msm_host->pdata->nonremovable)
msm_host->mmc->caps |= MMC_CAP_NONREMOVABLE;
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 5f139a5b9c87..999bd8e839de 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3791,10 +3791,6 @@ int sdhci_add_host(struct sdhci_host *host)
if (override_timeout_clk)
host->timeout_clk = override_timeout_clk;
-
- if (!(host->quirks2 & SDHCI_QUIRK2_USE_MAX_DISCARD_SIZE))
- mmc->max_busy_timeout = (1 << 27) / host->timeout_clk;
-
mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index a4017e6f6c8c..489aa2572692 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -452,12 +452,6 @@ struct sdhci_host {
* required frequency.
*/
#define SDHCI_QUIRK2_ALWAYS_USE_BASE_CLOCK (1<<19)
-/*
- * Dont use the max_discard_to in sdhci driver so that the maximum discard
- * unit gets picked by the mmc queue. Otherwise, it takes a long time for
- * secure discard kind of operations to complete.
- */
-#define SDHCI_QUIRK2_USE_MAX_DISCARD_SIZE (1<<20)
/*
* Ignore data timeout error for R1B commands as there will be no
@@ -465,20 +459,20 @@ struct sdhci_host {
* could be lager than the maximum timeout value that controller
* can handle.
*/
-#define SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD (1<<21)
+#define SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD (1<<20)
/*
* The preset value registers are not properly initialized by
* some hardware and hence preset value must not be enabled for
* such controllers.
*/
-#define SDHCI_QUIRK2_BROKEN_PRESET_VALUE (1<<22)
+#define SDHCI_QUIRK2_BROKEN_PRESET_VALUE (1<<21)
/*
* Some controllers define the usage of 0xF in data timeout counter
* register (0x2E) which is actually a reserved bit as per
* specification.
*/
-#define SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT (1<<23)
+#define SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT (1<<22)
/*
* This is applicable for controllers that advertize timeout clock
* value in capabilities register (bit 5-0) as just 50MHz whereas the