From 90c7ef70d1cd95d73d8e860209b06b1d0bae2c2f Mon Sep 17 00:00:00 2001 From: Shridhar Rasal Date: Tue, 7 Feb 2012 21:02:47 +0530 Subject: mmc: sdhci: quirk for not calculate max_discard_to Adding SDHCI_QUIRK_NO_CALC_MAX_DISCARD_TO for not to calculate max_discard_to which is deviation in setting max_discard. For some host controllers, combination of 1) calculated non-zero value of max_discard_to and 2) erase_group_def not set can result into setting max_discard value to pref_erase in sectors which is very less, so it takes long time for erase. With this change host controller can specify to calculate max_discard_to and based on that max_discard value will be set. bug 930767 Change-Id: I2c64ef8a6821620f2a65c06e25d2af68e3554a75 Signed-off-by: Shridhar Rasal Reviewed-on: http://git-master/r/79839 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sachin Nikam --- drivers/mmc/host/sdhci.c | 3 ++- include/linux/mmc/sdhci.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b1dd628ac648..50a268ea26d5 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2589,7 +2589,8 @@ int sdhci_add_host(struct sdhci_host *host) if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) host->timeout_clk = mmc->f_max / 1000; - mmc->max_discard_to = (1 << 27) / host->timeout_clk; + if (!(host->quirks & SDHCI_QUIRK_NO_CALC_MAX_DISCARD_TO)) + mmc->max_discard_to = (1 << 27) / host->timeout_clk; if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) host->flags |= SDHCI_AUTO_CMD12; diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 19abccaf0fb0..061f70ec01f9 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -91,6 +91,8 @@ struct sdhci_host { #define SDHCI_QUIRK_NON_STD_VOLTAGE_SWITCHING (1ULL<<32) /* Controller doesn't follow the standard frequency tuning procedure */ #define SDHCI_QUIRK_NON_STANDARD_TUNING (1LL<<33) +/* Controller doesn't calculate max_discard_to */ +#define SDHCI_QUIRK_NO_CALC_MAX_DISCARD_TO (1LL<<34) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ -- cgit v1.2.3