Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22375c75 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: card: Call blk_requeue_request() with queue-lock held"

parents cdb65593 ba52753a
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -2633,11 +2633,11 @@ static struct mmc_cmdq_req *mmc_blk_cmdq_rw_prep(
static void mmc_blk_cmdq_requeue_rw_rq(struct mmc_queue *mq,
				struct request *req)
{
	struct mmc_card *card = mq->card;
	struct mmc_host *host = card->host;
	struct request_queue *q = req->q;

	blk_requeue_request(req->q, req);
	mmc_put_card(host->card);
	spin_lock_irq(q->queue_lock);
	blk_requeue_request(q, req);
	spin_unlock_irq(q->queue_lock);
}

static int mmc_blk_cmdq_issue_rw_rq(struct mmc_queue *mq, struct request *req)
@@ -3543,9 +3543,16 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
			 * If issuing of the request fails with eitehr EBUSY or
			 * EAGAIN error, re-queue the request.
			 * This case would occur with ICE calls.
			 * For request which gets completed successfully or
			 * errored out, we release host lock in completion or
			 * error handling softirq context. But here the request
			 * is neither completed nor erred-out, so release the
			 * host lock explicitly.
			 */
			if (ret == -EBUSY || ret == -EAGAIN)
			if (ret == -EBUSY || ret == -EAGAIN) {
				mmc_blk_cmdq_requeue_rw_rq(mq, req);
				mmc_put_card(host->card);
			}
		}
	}