summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2011-06-28 17:16:02 +0300
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 16:07:29 +0200
commit42f50f4c5be00f76c3f4bff1ff1facd050f5bcb0 (patch)
tree86a43405ff3614349bd808322148d42b09669a8c /include
parent97fe0c658f1640dc2a4bbc071d72e738b0a27de5 (diff)
mmc: queue: let host controllers specify maximum discard timeout
Some host controllers will not operate without a hardware timeout that is limited in value. However large discards require large timeouts, so there needs to be a way to specify the maximum discard size. A host controller driver may now specify the maximum discard timeout possible so that max_discard_sectors can be calculated. However, for eMMC when the High Capacity Erase Group Size is not in use, the timeout calculation depends on clock rate which may change. For that case Preferred Erase Size is used instead. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org> Change-Id: I2d8111ab0a31a788feb1f23c87a7d00529193620 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30671 Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com> Tested-by: Ulf HANSSON <ulf.hansson@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/core.h1
-rw-r--r--include/linux/mmc/host.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index b6718e549a5..7a48ea06bbe 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -155,6 +155,7 @@ extern int mmc_can_trim(struct mmc_card *card);
extern int mmc_can_secure_erase_trim(struct mmc_card *card);
extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
unsigned int nr);
+extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1584b5236bb..c57925dbb45 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -231,6 +231,7 @@ struct mmc_host {
unsigned int max_req_size; /* maximum number of bytes in one req */
unsigned int max_blk_size; /* maximum size of one mmc block */
unsigned int max_blk_count; /* maximum number of blocks in one req */
+ unsigned int max_discard_to; /* max. discard timeout in ms */
/* private data */
spinlock_t lock; /* lock for claim and bus ops */