Merge "mmc: queue: Fix bug in mmc_queue_suspend() for CMDQ case"

This commit is contained in:
Linux Build Service Account 2015-10-17 20:38:01 -07:00 committed by Gerrit - the friendly Code Review server
commit 0dcd2def74
2 changed files with 18 additions and 4 deletions

View File

@ -1510,8 +1510,11 @@ clear_dcmd:
out:
blk_end_request(req, err, blk_rq_bytes(req));
if (test_and_clear_bit(0, &ctx_info->req_starved))
if (test_and_clear_bit(0, &ctx_info->req_starved)) {
blk_run_queue(mq->queue);
if (blk_queue_stopped(mq->queue))
wake_up_process(mq->thread);
}
mmc_release_host(host);
mmc_rpm_release(host, &card->dev);
return err ? 1 : 0;
@ -1642,8 +1645,11 @@ clear_dcmd:
out:
blk_end_request(req, err, blk_rq_bytes(req));
if (test_and_clear_bit(0, &ctx_info->req_starved))
if (test_and_clear_bit(0, &ctx_info->req_starved)) {
blk_run_queue(mq->queue);
if (blk_queue_stopped(mq->queue))
wake_up_process(mq->thread);
}
mmc_release_host(host);
mmc_rpm_release(host, &card->dev);
return err ? 1 : 0;
@ -3174,8 +3180,11 @@ out:
host->err_mrq = NULL;
mmc_rpm_release(host, &card->dev);
if (test_and_clear_bit(0, &ctx_info->req_starved))
if (test_and_clear_bit(0, &ctx_info->req_starved)) {
blk_run_queue(q);
if (blk_queue_stopped(mq->queue))
wake_up_process(mq->thread);
}
}
/* invoked by block layer in softirq context */
@ -3235,8 +3244,11 @@ out:
}
if (!test_bit(CMDQ_STATE_ERR, &ctx_info->curr_state) &&
test_and_clear_bit(0, &ctx_info->req_starved))
test_and_clear_bit(0, &ctx_info->req_starved)) {
blk_run_queue(mq->queue);
if (blk_queue_stopped(mq->queue))
wake_up_process(mq->thread);
}
mmc_release_host(host);
mmc_rpm_release(host, &host->card->dev);

View File

@ -777,6 +777,8 @@ int mmc_queue_suspend(struct mmc_queue *mq, int wait)
spin_lock_irqsave(q->queue_lock, flags);
blk_start_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
if (!rc)
up(&mq->thread_sem);
rc = -EBUSY;
}
}