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

Commit d9f72f76 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: detect change in resume if a new card is found"

parents d5873667 5ebdb445
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3472,6 +3472,9 @@ static void _mmc_detect_change(struct mmc_host *host, unsigned long delay,
	if (cd_irq && mmc_bus_manual_resume(host))
		host->ignore_bus_resume_flags = true;

	if (delayed_work_pending(&host->detect))
		cancel_delayed_work(&host->detect);

	mmc_schedule_delayed_work(&host->detect, delay);
}

+7 −1
Original line number Diff line number Diff line
@@ -1309,7 +1309,7 @@ static int _mmc_sd_resume(struct mmc_host *host)
	while (retries) {
		err = mmc_sd_init_card(host, host->card->ocr, host->card);

		if (err) {
		if (err && err != -ENOENT) {
			printk(KERN_ERR "%s: Re-init card rc = %d (retries = %d)\n",
			       mmc_hostname(host), err, retries);
			retries--;
@@ -1324,6 +1324,12 @@ static int _mmc_sd_resume(struct mmc_host *host)
#else
	err = mmc_sd_init_card(host, host->card->ocr, host->card);
#endif
	if (err == -ENOENT) {
		pr_debug("%s: %s: found a different card(%d), do detect change\n",
			mmc_hostname(host), __func__, err);
		mmc_card_set_removed(host->card);
		mmc_detect_change(host, msecs_to_jiffies(200));
	}
	mmc_card_clr_suspended(host->card);

	if (host->card->sdr104_blocked)