mmc: core: mmc sanitize feature support for v4.5
[deliverable/linux.git] / drivers / mmc / card / block.c
index 049445eb4f74c69bda3a7b061c669e3cc3ab6135..e85816e1634ab80546bb0d87eabfdc585612feee 100644 (file)
@@ -792,11 +792,18 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
        unsigned int from, nr, arg;
        int err = 0, type = MMC_BLK_SECDISCARD;
 
-       if (!mmc_can_secure_erase_trim(card)) {
+       if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) {
                err = -EOPNOTSUPP;
                goto out;
        }
 
+       /* The sanitize operation is supported at v4.5 only */
+       if (mmc_can_sanitize(card)) {
+               err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+                               EXT_CSD_SANITIZE_START, 1, 0);
+               goto out;
+       }
+
        from = blk_rq_pos(req);
        nr = blk_rq_sectors(req);
 
This page took 0.023405 seconds and 5 git commands to generate.