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

Commit 4ceaef34 authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti Committed by Gerrit - the friendly Code Review server
Browse files

mmc: add more trace logs and debug information



Add MMC_TRACE() events in gating and scaling path.
Also, add last successful and failed request timestamps
in struct mmc_host.

Change-Id: I22a138c073624136b858d4fa320aa0ff2d1d2c21
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 5f548341
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3739,6 +3739,7 @@ void mmc_blk_cmdq_complete_rq(struct request *rq)
	if (err_rwsem && !(err || cmdq_req->resp_err)) {
		mmc_host_clk_release(host);
		wake_up(&ctx_info->wait);
		host->last_completed_rq_time = ktime_get();
		mmc_put_card(host->card);
	}

+4 −0
Original line number Diff line number Diff line
@@ -455,12 +455,16 @@ int mmc_clk_update_freq(struct mmc_host *host,
		goto invalid_state;
	}

	MMC_TRACE(host, "clock scale state %d freq %lu\n",
			state, freq);
	err = host->bus_ops->change_bus_speed(host, &freq);
	if (!err)
		host->clk_scaling.curr_freq = freq;
	else
		pr_err("%s: %s: failed (%d) at freq=%lu\n",
			mmc_hostname(host), __func__, err, freq);
	MMC_TRACE(host, "clock scale state %d freq %lu done with err %d\n",
			state, freq, err);

invalid_state:
	if (cmdq_mode) {
+2 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ static void mmc_host_clk_gate_delayed(struct mmc_host *host)
		mmc_gate_clock(host);
		spin_lock_irqsave(&host->clk_lock, flags);
		pr_debug("%s: gated MCI clock\n", mmc_hostname(host));
		MMC_TRACE(host, "clocks are gated\n");
	}
	spin_unlock_irqrestore(&host->clk_lock, flags);
	mutex_unlock(&host->clk_gate_mutex);
@@ -193,6 +194,7 @@ void mmc_host_clk_hold(struct mmc_host *host)

		spin_lock_irqsave(&host->clk_lock, flags);
		pr_debug("%s: ungated MCI clock\n", mmc_hostname(host));
		MMC_TRACE(host, "clocks are ungated\n");
	}
	host->clk_requests++;
	spin_unlock_irqrestore(&host->clk_lock, flags);
+1 −0
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ static void sdhci_dumpregs(struct sdhci_host *host)
	}

	host->mmc->err_occurred = true;
	host->mmc->last_failed_rq_time = ktime_get();

	if (host->ops->dump_vendor_regs)
		host->ops->dump_vendor_regs(host);
+2 −0
Original line number Diff line number Diff line
@@ -584,6 +584,8 @@ struct mmc_host {

	bool			err_occurred;
	u32			err_stats[MMC_ERR_MAX];
	ktime_t			last_failed_rq_time;
	ktime_t			last_completed_rq_time;

	struct mmc_async_req	*areq;		/* active async req */
	struct mmc_context_info	context_info;	/* async synchronization info */