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

Commit e9748e03 authored by Ziyuan Xu's avatar Ziyuan Xu Committed by Ulf Hansson
Browse files

mmc: dw_mmc: force setup bus if active slots exist



It's necessary to setup bus if any slots are present.
- update clock after ctrl reset
- if the host has genpd node, we can guarantee the clock is
  available before starting request. Otherwies, the clock register
  is reset once power off the pd, and host can't output the active
  clock during communication.

Fixes: e9ed8835 ("mmc: dw_mmc: add runtime PM callback")
Fixes: df9bcc2b ("mmc: dw_mmc: add missing codes for runtime resume")
cc: <stable@vger.kernel.org>
Reported-by: default avatarRandy Li <randy.li@rock-chips.com>
Reported-by: default avatarS. Gilles <sgilles@math.umd.edu>
Signed-off-by: default avatarZiyuan Xu <xzy.xu@rock-chips.com>
Signed-off-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 7a308bb3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3354,11 +3354,12 @@ int dw_mci_runtime_resume(struct device *dev)

		if (!slot)
			continue;
		if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) {
		if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
			dw_mci_set_ios(slot->mmc, &slot->mmc->ios);

		/* Force setup bus to guarantee available clock output */
		dw_mci_setup_bus(slot, true);
	}
	}

	/* Now that slots are all setup, we can enable card detect */
	dw_mci_enable_cd(host);