mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
mmc: sdhci-dwc: Fix SDHCI_RESET_ALL for CQHCI for rk35xx
For rockchip sdhci controllers, SDHCI_RESET_ALL resets also CQHCI registers. Normally, SDHCI_RESET_ALL is not used while CQHCI is enabled, but that can happen on the error path. e.g. if mmc_cqe_recovery() fails, mmc_blk_reset() is called which, for a eMMC that does not support HW Reset, will cycle the bus power and the driver will perform SDHCI_RESET_ALL. So whenever performing SDHCI_RESET_ALL ensure CQHCI is deactivated. That will force the driver to reinitialize CQHCI when it is next used. Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com> Change-Id: Iee491501ff7e32e347303f5389f22eef9f8f658b
This commit is contained in:
@@ -529,6 +529,9 @@ static void rk35xx_sdhci_reset(struct sdhci_host *host, u8 mask)
|
||||
struct rk35xx_priv *priv = dwc_priv->priv;
|
||||
u32 extra = sdhci_readl(host, DECMSHC_EMMC_MISC_CON);
|
||||
|
||||
if ((host->mmc->caps2 & MMC_CAP2_CQE) && (mask & SDHCI_RESET_ALL))
|
||||
cqhci_deactivate(host->mmc);
|
||||
|
||||
if (mask & SDHCI_RESET_ALL && priv->reset) {
|
||||
reset_control_assert(priv->reset);
|
||||
udelay(1);
|
||||
|
||||
Reference in New Issue
Block a user