mmc: fixes for eMMC v4.5 discard operation
commit7c369b7f52feba0f10c6409e36552ff92bed2133
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 5 Apr 2012 11:45:47 +0000 (5 14:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Apr 2012 17:16:35 +0000 (27 10:16 -0700)
tree22ada94f0c087d31aa502a3fc831c0017e2158c0
parentcbd267314935af45bca6fcaabc99d6fa1268ec4c
mmc: fixes for eMMC v4.5 discard operation

commit 7194efb8f063ee3aa0cb50d9002348887e68ec10 upstream.

eMMC v4.5 discard operation is significantly different from the
existing trim operation because it is not guaranteed to work with
the new sanitize operation.  Consequently mmc_can_trim() is
separated from mmc_can_discard().

Also the new discard operation does not result in the sectors being
set to all-zeros, so discard_zeroes_data must not be set.

In addition, the new discard has the same timeout as trim, but from
v4.5 trim is defined to use the hc timeout.  The timeout calculation
is adjusted accordingly.

Fixes apply to linux 3.2 on.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/card/queue.c
drivers/mmc/core/core.c