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

Commit dd9f4d77 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: Increase the runtime PM reference count in try_claim_host"

parents 0af01de9 36371a16
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -2252,6 +2252,7 @@ int mmc_try_claim_host(struct mmc_host *host, unsigned int delay_ms)
	int claimed_host = 0;
	int claimed_host = 0;
	unsigned long flags;
	unsigned long flags;
	int retry_cnt = delay_ms/10;
	int retry_cnt = delay_ms/10;
	bool pm = false;


	do {
	do {
		spin_lock_irqsave(&host->lock, flags);
		spin_lock_irqsave(&host->lock, flags);
@@ -2260,11 +2261,17 @@ int mmc_try_claim_host(struct mmc_host *host, unsigned int delay_ms)
			host->claimer = current;
			host->claimer = current;
			host->claim_cnt += 1;
			host->claim_cnt += 1;
			claimed_host = 1;
			claimed_host = 1;
			if (host->claim_cnt == 1)
				pm = true;
		}
		}
		spin_unlock_irqrestore(&host->lock, flags);
		spin_unlock_irqrestore(&host->lock, flags);
		if (!claimed_host)
		if (!claimed_host)
			mmc_delay(10);
			mmc_delay(10);
	} while (!claimed_host && retry_cnt--);
	} while (!claimed_host && retry_cnt--);

	if (pm)
		pm_runtime_get_sync(mmc_dev(host));

	if (host->ops->enable && claimed_host && host->claim_cnt == 1)
	if (host->ops->enable && claimed_host && host->claim_cnt == 1)
		host->ops->enable(host);
		host->ops->enable(host);
	return claimed_host;
	return claimed_host;