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

Commit 79bed65f authored by Ram Prakash Gupta's avatar Ram Prakash Gupta
Browse files

mmc: core: Restrict number of request in driver queue



When voltage corner is in LSVS, on low load scenario and
there is sudden burst of requests, all device queue
slots are filled and it is needed to wait till all
requests are completed to scale up frequency. This
is leading to delay in scaling and impacting performance.
Fix this issue by only allowing one request in request queue
when device is running with lower speed mode.

Ref: 01deb37c7 on msm-4.9 kernel.

Change-Id: Ie73d29095d9fdd48f1f6aa1c8fa82921022137b9
Signed-off-by: default avatarRam Prakash Gupta <rampraka@codeaurora.org>
parent dcc90d4a
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -1569,6 +1569,8 @@ static int mmc_blk_cqe_issue_flush(struct mmc_queue *mq, struct request *req)
static int mmc_blk_cqe_issue_rw_rq(struct mmc_queue *mq, struct request *req)
{
	struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req);
	struct mmc_card *card = mq->card;
	struct mmc_host *host = card->host;
	int err = 0;

	mmc_blk_data_prep(mq, mqrq, 0, NULL, NULL);
@@ -1576,9 +1578,27 @@ static int mmc_blk_cqe_issue_rw_rq(struct mmc_queue *mq, struct request *req)

	mmc_deferred_scaling(mq->card->host);
	mmc_cqe_clk_scaling_start_busy(mq, mq->card->host, true);
	/*
	 * When voltage corner in LSVS on low load scenario and
	 * there is sudden burst of requests device queue all
	 * slots are filled and it is needed to wait till all
	 * requests are completed to scale up frequency. This
	 * is leading to delay in scaling and impacting performance.
	 * Fix this issue by only allowing one request in request queue
	 * when device is running with lower speed mode.
	 */
	if (host->clk_scaling.state == MMC_LOAD_LOW) {
		err = host->cqe_ops->cqe_wait_for_idle(host);
		if (err) {
			pr_err("%s: %s: CQE went in recovery path.\n",
				mmc_hostname(host), __func__);
			goto stop_scaling;
		}
	}

	err =  mmc_blk_cqe_start_req(mq->card->host, &mqrq->brq.mrq);

stop_scaling:
	if (err)
		mmc_cqe_clk_scaling_stop_busy(mq->card->host, true, false);