diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/card/block.c | 5 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 7 | ||||
-rw-r--r-- | drivers/mmc/card/queue.h | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 48a5dd740f3b..2206d4477dbb 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1726,6 +1726,7 @@ static u8 mmc_blk_prep_packed_list(struct mmc_queue *mq, struct request *req) | |||
1726 | break; | 1726 | break; |
1727 | 1727 | ||
1728 | if (req_op(next) == REQ_OP_DISCARD || | 1728 | if (req_op(next) == REQ_OP_DISCARD || |
1729 | req_op(next) == REQ_OP_SECURE_ERASE || | ||
1729 | req_op(next) == REQ_OP_FLUSH) | 1730 | req_op(next) == REQ_OP_FLUSH) |
1730 | break; | 1731 | break; |
1731 | 1732 | ||
@@ -2150,6 +2151,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
2150 | struct mmc_card *card = md->queue.card; | 2151 | struct mmc_card *card = md->queue.card; |
2151 | struct mmc_host *host = card->host; | 2152 | struct mmc_host *host = card->host; |
2152 | unsigned long flags; | 2153 | unsigned long flags; |
2154 | bool req_is_special = mmc_req_is_special(req); | ||
2153 | 2155 | ||
2154 | if (req && !mq->mqrq_prev->req) | 2156 | if (req && !mq->mqrq_prev->req) |
2155 | /* claim host only for the first request */ | 2157 | /* claim host only for the first request */ |
@@ -2190,8 +2192,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
2190 | } | 2192 | } |
2191 | 2193 | ||
2192 | out: | 2194 | out: |
2193 | if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) || | 2195 | if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) || req_is_special) |
2194 | mmc_req_is_special(req)) | ||
2195 | /* | 2196 | /* |
2196 | * Release host when there are no more requests | 2197 | * Release host when there are no more requests |
2197 | * and after special request(discard, flush) is done. | 2198 | * and after special request(discard, flush) is done. |
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index bf14642a576a..708057261b38 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -33,7 +33,8 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) | |||
33 | /* | 33 | /* |
34 | * We only like normal block requests and discards. | 34 | * We only like normal block requests and discards. |
35 | */ | 35 | */ |
36 | if (req->cmd_type != REQ_TYPE_FS && req_op(req) != REQ_OP_DISCARD) { | 36 | if (req->cmd_type != REQ_TYPE_FS && req_op(req) != REQ_OP_DISCARD && |
37 | req_op(req) != REQ_OP_SECURE_ERASE) { | ||
37 | blk_dump_rq_flags(req, "MMC bad request"); | 38 | blk_dump_rq_flags(req, "MMC bad request"); |
38 | return BLKPREP_KILL; | 39 | return BLKPREP_KILL; |
39 | } | 40 | } |
@@ -64,6 +65,8 @@ static int mmc_queue_thread(void *d) | |||
64 | spin_unlock_irq(q->queue_lock); | 65 | spin_unlock_irq(q->queue_lock); |
65 | 66 | ||
66 | if (req || mq->mqrq_prev->req) { | 67 | if (req || mq->mqrq_prev->req) { |
68 | bool req_is_special = mmc_req_is_special(req); | ||
69 | |||
67 | set_current_state(TASK_RUNNING); | 70 | set_current_state(TASK_RUNNING); |
68 | mq->issue_fn(mq, req); | 71 | mq->issue_fn(mq, req); |
69 | cond_resched(); | 72 | cond_resched(); |
@@ -79,7 +82,7 @@ static int mmc_queue_thread(void *d) | |||
79 | * has been finished. Do not assign it to previous | 82 | * has been finished. Do not assign it to previous |
80 | * request. | 83 | * request. |
81 | */ | 84 | */ |
82 | if (mmc_req_is_special(req)) | 85 | if (req_is_special) |
83 | mq->mqrq_cur->req = NULL; | 86 | mq->mqrq_cur->req = NULL; |
84 | 87 | ||
85 | mq->mqrq_prev->brq.mrq.data = NULL; | 88 | mq->mqrq_prev->brq.mrq.data = NULL; |
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index d62531124d54..fee5e1271465 100644 --- a/drivers/mmc/card/queue.h +++ b/drivers/mmc/card/queue.h | |||
@@ -4,7 +4,9 @@ | |||
4 | static inline bool mmc_req_is_special(struct request *req) | 4 | static inline bool mmc_req_is_special(struct request *req) |
5 | { | 5 | { |
6 | return req && | 6 | return req && |
7 | (req_op(req) == REQ_OP_FLUSH || req_op(req) == REQ_OP_DISCARD); | 7 | (req_op(req) == REQ_OP_FLUSH || |
8 | req_op(req) == REQ_OP_DISCARD || | ||
9 | req_op(req) == REQ_OP_SECURE_ERASE); | ||
8 | } | 10 | } |
9 | 11 | ||
10 | struct request; | 12 | struct request; |