mmc: core: Optimize case for exactly one erase-group budget

In the (not so unlikely) case that the mmc controller timeout budget is
enough for exactly one erase-group, the simplification of allowing one
sector has an enormous performance penalty. We optimize this special case
by introducing a flag that prohibits erase-group boundary crossing, so
that we can allow trimming more than one sector at a time.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
David Jander 2015-06-23 11:43:52 +02:00 committed by Ulf Hansson
parent 2c6625cd54
commit 642c28ab86
2 changed files with 35 additions and 4 deletions

View file

@ -283,6 +283,7 @@ struct mmc_card {
unsigned int erase_size; /* erase size in sectors */
unsigned int erase_shift; /* if erase unit is power 2 */
unsigned int pref_erase; /* in sectors */
unsigned int eg_boundary; /* don't cross erase-group boundaries */
u8 erased_byte; /* value of erased bytes */
u32 raw_cid[4]; /* raw card CID */