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

Commit ae001c2e 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: Do regular power cycle when lacking eMMC HW reset support"

parents 1b83a4b4 ea7ba3ab
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3969,8 +3969,9 @@ int mmc_hw_reset(struct mmc_host *host)
	ret = host->bus_ops->reset(host);
	mmc_bus_put(host);

	if (ret != -EOPNOTSUPP)
		pr_warn("%s: tried to reset card\n", mmc_hostname(host));
	if (ret)
		pr_warn("%s: tried to reset card, got error %d\n",
			mmc_hostname(host), ret);

	return ret;
}
+11 −15
Original line number Diff line number Diff line
@@ -2893,21 +2893,17 @@ static int mmc_reset(struct mmc_host *host)
{
	struct mmc_card *card = host->card;

	if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
		return -EOPNOTSUPP;

	if (!mmc_can_reset(card))
		return -EOPNOTSUPP;

	mmc_host_clk_hold(host);
	if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
	     mmc_can_reset(card)) {
		/* If the card accept RST_n signal, send it. */
		mmc_set_clock(host, host->f_init);

		host->ops->hw_reset(host);

		/* Set initial state and call mmc_set_ios */
		mmc_set_initial_state(host);
	mmc_host_clk_release(host);

	} else {
		/* Do a brute force power cycle */
		mmc_power_cycle(host, card->ocr);
	}
	return mmc_init_card(host, card->ocr, card);
}