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

Commit f6e5432a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: claim host before halt in pm runtime idle"

parents d6f87ac7 8bb5b2b8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1203,6 +1203,7 @@ EXPORT_SYMBOL(mmc_check_bkops);
 *	@card: MMC card to start BKOPS
 *
 *      Send START_BKOPS to the card.
 *      The function should be called with claimed host.
*/
void mmc_start_manual_bkops(struct mmc_card *card)
{
@@ -1216,7 +1217,6 @@ void mmc_start_manual_bkops(struct mmc_card *card)
	if (mmc_card_doing_bkops(card))
		return;

	mmc_claim_host(card->host);
	err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BKOPS_START,
				1, 0, false, true, false);
	if (err) {
@@ -1227,7 +1227,6 @@ void mmc_start_manual_bkops(struct mmc_card *card)
		mmc_update_bkops_start(&card->bkops.stats);
		card->bkops.needs_manual = false;
	}
	mmc_release_host(card->host);
}
EXPORT_SYMBOL(mmc_start_manual_bkops);

+6 −2
Original line number Diff line number Diff line
@@ -2442,6 +2442,9 @@ static int mmc_runtime_idle(struct mmc_host *host)
	bool halt_cmdq;

	BUG_ON(!host->card);

	mmc_claim_host(host);

	halt_cmdq = mmc_card_cmdq(host->card) &&
			(host->card->bkops.needs_check ||
			 host->card->bkops.needs_manual);
@@ -2466,10 +2469,9 @@ static int mmc_runtime_idle(struct mmc_host *host)
		host->card->bkops.needs_check = false;

	if (host->card->bkops.needs_check) {
		mmc_claim_host(host);
		mmc_check_bkops(host->card);
		host->card->bkops.needs_check = false;
		mmc_release_host(host);

	}

	if (host->card->bkops.needs_manual)
@@ -2481,6 +2483,7 @@ static int mmc_runtime_idle(struct mmc_host *host)
			pr_err("%s: %s failed to unhalt cmdq (%d)\n",
					mmc_hostname(host), __func__, err);
	}

out:
	/*
	 * TODO: consider prolonging suspend when bkops
@@ -2489,6 +2492,7 @@ out:
	 * */
	pm_schedule_suspend(&host->card->dev, MMC_AUTOSUSPEND_DELAY_MS);
no_suspend:
	mmc_release_host(host);
	pm_runtime_mark_last_busy(&host->card->dev);
	/* return negative value in order to avoid autosuspend */
	return (err) ? err : NO_AUTOSUSPEND;