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

Commit 930e70e9 authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

mmc: sdhci-msm: Ensure larger discard size



Discard size calculation uses max_busy_timeout in deriving the
value. So, we can ensure a larger discard size by setting this
timeout as zero. If this timeout is zero then it takes max erase
timeout vlaue (which is 60sec) in the discard size calculation.

And qcom SDHC can support h/w based busy detection, So
we need set MMC_CAP_NEED_RSP_BUSY capability flag.

Since Qcom SDHC can support h/w based busy detection for R1b
commands, this timeout value is not relevant for us.
Setting it zero won't affect in any operation provied
MMC_CAP_NEED_RSP_BUSY cap is set.

Change-Id: Ib20a1e536d2e24cf8de1e927715a8a3aa7f0ae27
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent bf4eaa44
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -3214,8 +3214,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)

	msm_host->mmc->caps |= MMC_CAP_AGGRESSIVE_PM;
	msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;

	msm_host->pltfm_init_done = true;
	msm_host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;

#if defined(CONFIG_SDC_QTI)
	msm_host->mmc->caps2 |= MMC_CAP2_CLK_SCALE;
@@ -3233,6 +3232,20 @@ static int sdhci_msm_probe(struct platform_device *pdev)
		goto pm_runtime_disable;
	sdhci_msm_set_regulator_caps(msm_host);

	/*
	 * Ensure larger discard size by setting max_busy_timeout.
	 * This has to set only after sdhci_add_host so that our
	 * value won't be over-written.
	 */
	host->mmc->max_busy_timeout = 0;

	/*
	 * Set platfm_init_done only after sdhci_add_host().
	 * So that we don't turn off vqmmc while we reset sdhc as
	 * part of sdhci_add_host().
	 */
	msm_host->pltfm_init_done = true;

	pm_runtime_mark_last_busy(&pdev->dev);
	pm_runtime_put_autosuspend(&pdev->dev);