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

Commit 832d9eaf authored by Shaik Sajida Bhanu's avatar Shaik Sajida Bhanu
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 avatarShaik Sajida Bhanu <sbhanu@codeaurora.org>
parent b8bfad92
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -406,6 +406,8 @@ int mmc_clk_update_freq(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, "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
@@ -533,7 +535,9 @@ 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(host, target_freq, clk_scaling.state);
	if (err && err != -EAGAIN)
		pr_err("%s: failed on deferred scale clocks (%d)\n",
+6 −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:
@@ -111,6 +114,9 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req)
				mmc_cqe_recovery_notifier(mrq);
			return BLK_EH_RESET_TIMER;
		}
		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);
		/* The request has gone already */
		return BLK_EH_DONE;
	default:
+4 −0
Original line number Diff line number Diff line
@@ -953,6 +953,7 @@ static int mmc_sdio_suspend(struct mmc_host *host)
	cancel_delayed_work_sync(&host->sdio_irq_work);

	mmc_claim_host(host);
	mmc_log_string(host, "Enter\n");

	if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host))
		sdio_disable_wide(host->card);
@@ -964,6 +965,7 @@ static int mmc_sdio_suspend(struct mmc_host *host)
		mmc_retune_needed(host);
	}

	mmc_log_string(host, "Exit\n");
	mmc_release_host(host);

	return 0;
@@ -975,6 +977,7 @@ static int mmc_sdio_resume(struct mmc_host *host)

	/* Basic card reinitialization. */
	mmc_claim_host(host);
	mmc_log_string(host, "Enter\n");

	/*
	 * Restore power and reinitialize the card when needed. Note that a
@@ -1014,6 +1017,7 @@ static int mmc_sdio_resume(struct mmc_host *host)
	}

out:
	mmc_log_string(host, "Exit err: %d\n", err);
	mmc_release_host(host);

	host->pm_flags &= ~MMC_PM_KEEP_POWER;
+6 −1
Original line number Diff line number Diff line
@@ -403,8 +403,10 @@ static void cqhci_off(struct mmc_host *mmc)
				 reg & CQHCI_HALT, 0, CQHCI_OFF_TIMEOUT);
	if (err < 0)
		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;
}
@@ -637,6 +639,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",
@@ -756,6 +759,8 @@ static void cqhci_error_irq(struct mmc_host *mmc, u32 status, int cmd_error,

	pr_debug("%s: cqhci: error IRQ status: 0x%08x cmd error %d data error %d TERRI: 0x%08x\n",
		 mmc_hostname(mmc), status, cmd_error, data_error, terri);
	mmc_log_string(mmc, "cqhci: status:0x%08x TERRI:0x%08x\n",
		status, terri);

	/* Forget about errors when recovery has already been triggered */
	if (cq_host->recovery_halt)
+12 −0
Original line number Diff line number Diff line
@@ -1908,6 +1908,9 @@ static void sdhci_msm_check_power_status(struct sdhci_host *host, u32 req_type)
			dev_warn(&msm_host->pdev->dev,
				 "%s: pwr_irq for req: (%d) timed out\n",
				 mmc_hostname(host->mmc), req_type);
			mmc_log_string(host->mmc,
				"request(%d) timed out waiting for pwr_irq\n",
				req_type);
	}

	if (mmc->card && mmc->ops->get_cd && !mmc->ops->get_cd(mmc) &&
@@ -1932,6 +1935,11 @@ static void sdhci_msm_dump_pwr_ctrl_regs(struct sdhci_host *host)
		msm_host_readl(msm_host, host, msm_offset->core_pwrctl_status),
		msm_host_readl(msm_host, host, msm_offset->core_pwrctl_mask),
		msm_host_readl(msm_host, host, msm_offset->core_pwrctl_ctl));
	mmc_log_string(host->mmc,
		"Sts: 0x%08x | Mask: 0x%08x | Ctrl: 0x%08x\n",
		msm_host_readl(msm_host, host, msm_offset->core_pwrctl_status),
		msm_host_readl(msm_host, host, msm_offset->core_pwrctl_mask),
		msm_host_readl(msm_host, host, msm_offset->core_pwrctl_ctl));
}

static int sdhci_msm_clear_pwrctl_status(struct sdhci_host *host, u32 value)
@@ -3246,6 +3254,10 @@ static void sdhci_msm_dump_vendor_regs(struct sdhci_host *host)
	if (msm_host->cq_host)
		sdhci_msm_cqe_dump_debug_ram(host);

	mmc_log_string(host->mmc, "Data cnt: 0x%08x | Fifo cnt: 0x%08x\n",
		readl_relaxed(host->ioaddr + msm_offset->core_mci_data_cnt),
		readl_relaxed(host->ioaddr + msm_offset->core_mci_fifo_cnt));

	SDHCI_MSM_DUMP(
			"Data cnt: 0x%08x | Fifo cnt: 0x%08x | Int sts: 0x%08x\n",
		readl_relaxed(host->ioaddr + msm_offset->core_mci_data_cnt),
Loading