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

Commit deb997b9 authored by Sarthak Garg's avatar Sarthak Garg
Browse files

mmc: core: Add debug enhancement logs



Add debug enhancement logs to notify request timeout, when cqe is
turned off and when deferred scaling happens.

Change-Id: Ib499f41632427cba3ab0b67e04d605b6cf4419f5
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
parent 97f9bbc4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -405,6 +405,10 @@ int mmc_clk_update_freq_deferred(struct mmc_host *host,
	else
		pr_err("%s: %s: failed (%d) at freq=%lu\n",
			mmc_hostname(host), __func__, err, freq);

	mmc_log_string(host,
			"deferred clock scale state %d freq %lu done with err %d\n",
			state, freq, err);
	/*
	 * CQE would be enabled as part of CQE issueing path
	 * So no need to unhalt it explicitly
@@ -613,6 +617,8 @@ void mmc_deferred_scaling(struct mmc_host *host)
	pr_debug("%s: doing deferred frequency change (%lu) (%s)\n",
				mmc_hostname(host),
				target_freq, current->comm);
	mmc_log_string(host, "doing deferred frequency change (%lu) (%s)\n",
			target_freq, current->comm);

	err = mmc_clk_update_freq_deferred(host, target_freq,
		clk_scaling.state);
+10 −0
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req)
	enum mmc_issue_type issue_type = mmc_issue_type(mq, req);
	bool recovery_needed = false;

	mmc_log_string(host,
			"Request timed out! Active reqs: %d Req: %p Tag: %d\n",
			mmc_cqe_qcnt(mq), req, req->tag);
	switch (issue_type) {
	case MMC_ISSUE_ASYNC:
	case MMC_ISSUE_DCMD:
@@ -112,6 +115,13 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req)
			return BLK_EH_RESET_TIMER;
		}
		/* No timeout (XXX: huh? comment doesn't make much sense) */

		pr_info("%s: %s: Timeout even before req reaching LDD, completing the req. Active reqs: %d Req: %p Tag: %d\n",
				mmc_hostname(host), __func__,
				mmc_cqe_qcnt(mq), req, req->tag);
		mmc_log_string(host,
				"Timeout even before req reaching LDD,completing the req. Active reqs: %d Req: %p Tag: %d\n",
				mmc_cqe_qcnt(mq), req, req->tag);
		blk_mq_complete_request(req);
		return BLK_EH_DONE;
	default:
+4 −2
Original line number Diff line number Diff line
@@ -409,9 +409,10 @@ static void cqhci_off(struct mmc_host *mmc)

	if (timed_out && !(reg & CQHCI_HALT))
		pr_err("%s: cqhci: CQE stuck on\n", mmc_hostname(mmc));
	else
	else {
		pr_debug("%s: cqhci: CQE off\n", mmc_hostname(mmc));

		mmc_log_string(mmc, "cqhci: CQE off\n");
	}
	mmc->cqe_on = false;
}

@@ -663,6 +664,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
	if (!mmc->cqe_on) {
		cqhci_writel(cq_host, 0, CQHCI_CTL);
		mmc->cqe_on = true;
		mmc_log_string(mmc, "cqhci: CQE on\n");
		pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
		if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) {
			pr_err("%s: cqhci: CQE failed to exit halt state\n",