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

Commit ba7086c1 authored by Ritesh Harjani's avatar Ritesh Harjani
Browse files

mmc: sdhci-msm: Dont wait infinitely for pwr_irq interrupt



Currently there is one rare case where suspend thread trying
to suspend sdhci-msm waits infinitely for pwr_irq interrupt
from hardware which never gets raised and thus watchdog barks
happens.

Change this waiting to wait_for_completion_timeout.

Change-Id: Ic4e9bca91b5496409b4afe2be2892c83aa390e95
Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
parent 7420553f
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -196,6 +196,9 @@
#define MAX_DRV_TYPES_SUPPORTED_HS200	4
#define MSM_AUTOSUSPEND_DELAY_MS 100

/* Timeout value to avoid infinite waiting for pwr_irq */
#define MSM_PWR_IRQ_TIMEOUT_MS 5000

static const u32 tuning_block_64[] = {
	0x00FF0FFF, 0xCCC3CCFF, 0xFFCC3CC3, 0xEFFEFFFE,
	0xDDFFDFFF, 0xFBFFFBFF, 0xFF7FFFBF, 0xEFBDF777,
@@ -2578,8 +2581,10 @@ static void sdhci_msm_check_power_status(struct sdhci_host *host, u32 req_type)
	 */
	if (done)
		init_completion(&msm_host->pwr_irq_completion);
	else
		wait_for_completion(&msm_host->pwr_irq_completion);
	else if (!wait_for_completion_timeout(&msm_host->pwr_irq_completion,
				msecs_to_jiffies(MSM_PWR_IRQ_TIMEOUT_MS)))
		__WARN_printf("%s: request(%d) timed out waiting for pwr_irq\n",
					mmc_hostname(host->mmc), req_type);

	pr_debug("%s: %s: request %d done\n", mmc_hostname(host->mmc),
			__func__, req_type);