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

Commit 55151ee9 authored by Konstantin Dorfman's avatar Konstantin Dorfman Committed by Ram Prakash Gupta
Browse files

mmc: sdhci-msm: Add tracepoints to enhance pm debugging



Instrument the sdhci-msm platform driver with tracepoints to aid in
debugging issues and identifying latencies in the following
paths:
* System suspend/resume
* Runtime suspend/resume.

Change-Id: I4fed1c2ccba7d5d7f978f161e7985c98e869d1d8
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
[xiaonian@codeaurora.org: fixedtrivial merge conflicts]
Signed-off-by: default avatarXiaonian Wang <xiaonian@codeaurora.org>
Signed-off-by: default avatarRam Prakash Gupta <rampraka@codeaurora.org>
parent 2cdbda7c
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -5511,6 +5511,7 @@ static int sdhci_msm_runtime_suspend(struct device *dev)
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	struct sdhci_msm_host *msm_host = pltfm_host->priv;
	int ret;
	ktime_t start = ktime_get();

	if (host->mmc->card && mmc_card_sdio(host->mmc->card))
		goto defer_disable_host_irq;
@@ -5536,7 +5537,8 @@ static int sdhci_msm_runtime_suspend(struct device *dev)
			pr_err("%s: failed to suspend crypto engine %d\n",
					mmc_hostname(host->mmc), ret);
	}

	trace_sdhci_msm_runtime_suspend(mmc_hostname(host->mmc), 0,
			ktime_to_us(ktime_sub(ktime_get(), start)));
	return 0;
}

@@ -5546,6 +5548,7 @@ static int sdhci_msm_runtime_resume(struct device *dev)
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	struct sdhci_msm_host *msm_host = pltfm_host->priv;
	int ret;
	ktime_t start = ktime_get();

	if (host->is_crypto_en) {
		ret = sdhci_msm_enable_controller_clock(host);
@@ -5568,6 +5571,9 @@ static int sdhci_msm_runtime_resume(struct device *dev)

defer_enable_host_irq:
	enable_irq(msm_host->pwr_irq);

	trace_sdhci_msm_runtime_resume(mmc_hostname(host->mmc), 0,
			ktime_to_us(ktime_sub(ktime_get(), start)));
	return 0;
}

@@ -5578,6 +5584,7 @@ static int sdhci_msm_suspend(struct device *dev)
	struct sdhci_msm_host *msm_host = pltfm_host->priv;
	int ret = 0;
	int sdio_cfg = 0;
	ktime_t start = ktime_get();

	if (gpio_is_valid(msm_host->pdata->status_gpio) &&
			 (msm_host->mmc->slot.cd_irq >= 0))
@@ -5596,6 +5603,9 @@ static int sdhci_msm_suspend(struct device *dev)
		if (sdio_cfg)
			sdhci_cfg_irq(host, false, true);
	}

	trace_sdhci_msm_suspend(mmc_hostname(host->mmc), ret,
			ktime_to_us(ktime_sub(ktime_get(), start)));
	return ret;
}

@@ -5606,6 +5616,7 @@ static int sdhci_msm_resume(struct device *dev)
	struct sdhci_msm_host *msm_host = pltfm_host->priv;
	int ret = 0;
	int sdio_cfg = 0;
	ktime_t start = ktime_get();

	if (gpio_is_valid(msm_host->pdata->status_gpio) &&
			 (msm_host->mmc->slot.cd_irq >= 0))
@@ -5624,6 +5635,9 @@ static int sdhci_msm_resume(struct device *dev)
		if (sdio_cfg)
			sdhci_cfg_irq(host, true, true);
	}

	trace_sdhci_msm_resume(mmc_hostname(host->mmc), ret,
			ktime_to_us(ktime_sub(ktime_get(), start)));
	return ret;
}