summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-28 00:46:51 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-28 00:46:51 -0800
commitc6eacb9bdb8e0ca12cdc7389ff1ca40edf62adf0 (patch)
tree75c6e155ec73e68c2e6c5008e58db178032fbe32
parentb267f1a21a8c4371cdb60dbaf208362a28446ebb (diff)
parent4923b2f8d6b84ad1419993b2ae662338d35b40ca (diff)
Merge "mmc: card: use blk_cleanup_queue() during shutdown/reboot"
-rw-r--r--drivers/mmc/card/block.c2
-rw-r--r--drivers/mmc/card/queue.c18
2 files changed, 12 insertions, 8 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 5743588aa52b..efbecb6e1dd0 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -4068,7 +4068,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
INIT_LIST_HEAD(&md->part);
md->usage = 1;
- ret = mmc_init_queue(&md->queue, card, &md->lock, subname, area_type);
+ ret = mmc_init_queue(&md->queue, card, NULL, subname, area_type);
if (ret)
goto err_putdisk;
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 75a51bd2fc0b..f5dbb67ba929 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -724,15 +724,13 @@ int mmc_queue_suspend(struct mmc_queue *mq, int wait)
if (wait) {
/*
- * After blk_stop_queue is called, wait for all
+ * After blk_cleanup_queue is called, wait for all
* active_reqs to complete.
* Then wait for cmdq thread to exit before calling
* cmdq shutdown to avoid race between issuing
* requests and shutdown of cmdq.
*/
- spin_lock_irqsave(q->queue_lock, flags);
- blk_stop_queue(q);
- spin_unlock_irqrestore(q->queue_lock, flags);
+ blk_cleanup_queue(q);
if (host->cmdq_ctx.active_reqs)
wait_for_completion(
@@ -757,9 +755,15 @@ int mmc_queue_suspend(struct mmc_queue *mq, int wait)
}
if (!(test_and_set_bit(MMC_QUEUE_SUSPENDED, &mq->flags))) {
- spin_lock_irqsave(q->queue_lock, flags);
- blk_stop_queue(q);
- spin_unlock_irqrestore(q->queue_lock, flags);
+ if (!wait) {
+ /* suspend/stop the queue in case of suspend */
+ spin_lock_irqsave(q->queue_lock, flags);
+ blk_stop_queue(q);
+ spin_unlock_irqrestore(q->queue_lock, flags);
+ } else {
+ /* shutdown the queue in case of shutdown/reboot */
+ blk_cleanup_queue(q);
+ }
rc = down_trylock(&mq->thread_sem);
if (rc && !wait) {