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

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

mmc: sdhci-msm: Fix mmc card stuck issue for sanitize cmd



Sanitize uses R1b response type which converts to R1 if busy
timeout for a request is greater than the host's max_bus_timeout which
happens in most of the R1b commands like flush/erase. In such cases the
present state register cannot be used to check for card status based on
DAT0 line status, as it always remains low.

Fix this issue by setting host's max busy timeout as zero so that every
busy command follows R1b path, which uses the interrupt mechanism depending
on the controller capability MMC_CAP_WAIT_WHILE_BUSY. In addition, the
quirk SDHCI_QUIRK2_IGNORE_DATATOUT_FOR_R1BCMD is also present to allow
controller to wait for busy state to complete without triggering the
data timeout interrupt.

Change-Id: I0ba98ac2f4e42f8184be2407b8f0f9b4ded552b9
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
parent a18d6173
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -5428,6 +5428,13 @@ static int sdhci_msm_probe(struct platform_device *pdev)
		goto vreg_deinit;
	}

	/*
	 * To avoid polling and to avoid this R1b command conversion
	 * to R1 command if the requested busy timeout > host's max
	 * busy timeout in case of sanitize, erase or any R1b command
	 */
	host->mmc->max_busy_timeout = 0;

	msm_host->pltfm_init_done = true;

	pm_runtime_set_active(&pdev->dev);