Skip to content

Commit c7ce645

Browse files
shawn1221Ulf Hansson
authored andcommitted
mmc: sdhci-of-dwcmshc: Disable internal clock auto gate for Rockchip SOCs
Enabling CMDQ support can lead to random occurrences of the error log when there are RPMB access and data flush executed: "mmc2: Timeout waiting for hardware interrupt." Enabling CMDQ and then issuing a DCMD as the final command before disabling it causes the eMMC controller to auto-gate its internal clock. Chip simulation shows this results in a state machine mismatch after CMDQ mode exit, triggering data-timeout errors for all subsequent read and write operations. Therefore, the auto-clock-gate function must be disabled whenever CMDQ is enabled. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Fixes: fda1e0a ("mmc: sdhci-of-dwcmshc: Add command queue support for rockchip SOCs") Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent e2bbd95 commit c7ce645

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mmc/host/sdhci-of-dwcmshc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,10 +726,11 @@ static void dwcmshc_rk3568_set_clock(struct sdhci_host *host, unsigned int clock
726726

727727
sdhci_set_clock(host, clock);
728728

729-
/* Disable cmd conflict check */
729+
/* Disable cmd conflict check and internal clock gate */
730730
reg = dwc_priv->vendor_specific_area1 + DWCMSHC_HOST_CTRL3;
731731
extra = sdhci_readl(host, reg);
732732
extra &= ~BIT(0);
733+
extra |= BIT(4);
733734
sdhci_writel(host, extra, reg);
734735

735736
if (clock <= 52000000) {

0 commit comments

Comments
 (0)