From 861ecf399bd1c94c0b640e1b8da7691b1d0b08f3 Mon Sep 17 00:00:00 2001 From: Venkat Gopalakrishnan Date: Thu, 28 Jan 2016 18:57:07 -0800 Subject: mmc: queue: Don't peek requests when queue is stopped Make sure we don't peek the block layer queue and act on it when block queue is stopped. The block queue will be stopped when mmc block is suspended, wait till it is properly resumed before pulling new requests. Change-Id: Ifc369687c13dae904271e8f92d3604edbd667d82 Signed-off-by: Venkat Gopalakrishnan --- drivers/mmc/card/queue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/mmc/card/queue.c') diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 01e87f4480ae..bc5ed3924c98 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -59,9 +59,11 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) static struct request *mmc_peek_request(struct mmc_queue *mq) { struct request_queue *q = mq->queue; + mq->cmdq_req_peeked = NULL; spin_lock_irq(q->queue_lock); - mq->cmdq_req_peeked = blk_peek_request(q); + if (!blk_queue_stopped(q)) + mq->cmdq_req_peeked = blk_peek_request(q); spin_unlock_irq(q->queue_lock); return mq->cmdq_req_peeked; -- cgit v1.2.3