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

Commit 8f8ab945 authored by Pavan Anamula's avatar Pavan Anamula
Browse files

mmc: core: fix race between mmc_power_off and mmc_power_up



In case card detect IRQ is triggered before mmc_add_host(), then
there could be a potential race between mmc_power_off() which gets
called frommmc_rescan() of card detect IRQ handler and
mmc_start_host() which gets called from mmc_add_host(). This may
turn off the clocks while mmc_start_host() is still running and thus
may result in an un-clocked register access.

Change-Id: I90ff99fb8e018b00600bf18197a2bcaf83ff1bc4
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
Signed-off-by: default avatarPavan Anamula <pavana@codeaurora.org>
parent 0600f6c1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3716,6 +3716,7 @@ void mmc_rescan(struct work_struct *work)

void mmc_start_host(struct mmc_host *host)
{
	mmc_claim_host(host);
	host->f_init = max(freqs[0], host->f_min);
	host->rescan_disable = 0;
	host->ios.power_mode = MMC_POWER_UNDEFINED;
@@ -3724,6 +3725,7 @@ void mmc_start_host(struct mmc_host *host)
	else
		mmc_power_up(host, host->ocr_avail);
	mmc_gpiod_request_cd_irq(host);
	mmc_release_host(host);
	_mmc_detect_change(host, 0, false);
}