aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r--drivers/mmc/core/sd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index c2db94dab711..2b4fc2205b53 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -231,6 +231,8 @@ static int mmc_read_ssr(struct mmc_card *card)
231{ 231{
232 unsigned int au, es, et, eo; 232 unsigned int au, es, et, eo;
233 __be32 *raw_ssr; 233 __be32 *raw_ssr;
234 u32 resp[4] = {};
235 u8 discard_support;
234 int i; 236 int i;
235 237
236 if (!(card->csd.cmdclass & CCC_APP_SPEC)) { 238 if (!(card->csd.cmdclass & CCC_APP_SPEC)) {
@@ -276,7 +278,13 @@ static int mmc_read_ssr(struct mmc_card *card)
276 } 278 }
277 } 279 }
278 280
279 card->erase_arg = SD_ERASE_ARG; 281 /*
282 * starting SD5.1 discard is supported if DISCARD_SUPPORT (b313) is set
283 */
284 resp[3] = card->raw_ssr[6];
285 discard_support = UNSTUFF_BITS(resp, 313 - 288, 1);
286 card->erase_arg = (card->scr.sda_specx && discard_support) ?
287 SD_DISCARD_ARG : SD_ERASE_ARG;
280 288
281 return 0; 289 return 0;
282} 290}