Skip to content

Commit e2bbd95

Browse files
author
Ulf Hansson
committed
mmc: Merge branch fixes into next
Merge the mmc fixes for v6.18-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.19. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2 parents b1f856b + 7475287 commit e2bbd95

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,19 @@ static void dwcmshc_adma_write_desc(struct sdhci_host *host, void **desc,
352352
sdhci_adma_write_desc(host, desc, addr, len, cmd);
353353
}
354354

355+
static void dwcmshc_reset(struct sdhci_host *host, u8 mask)
356+
{
357+
sdhci_reset(host, mask);
358+
359+
/* The dwcmshc does not comply with the SDHCI specification
360+
* regarding the "Software Reset for CMD line should clear 'Command
361+
* Complete' in the Normal Interrupt Status Register." Clear the bit
362+
* here to compensate for this quirk.
363+
*/
364+
if (mask & SDHCI_RESET_CMD)
365+
sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
366+
}
367+
355368
static unsigned int dwcmshc_get_max_clock(struct sdhci_host *host)
356369
{
357370
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -964,15 +977,7 @@ static void th1520_sdhci_reset(struct sdhci_host *host, u8 mask)
964977
struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host);
965978
u16 ctrl_2;
966979

967-
sdhci_reset(host, mask);
968-
969-
/* The T-Head 1520 SoC does not comply with the SDHCI specification
970-
* regarding the "Software Reset for CMD line should clear 'Command
971-
* Complete' in the Normal Interrupt Status Register." Clear the bit
972-
* here to compensate for this quirk.
973-
*/
974-
if (mask & SDHCI_RESET_CMD)
975-
sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
980+
dwcmshc_reset(host, mask);
976981

977982
if (priv->flags & FLAG_IO_FIXED_1V8) {
978983
ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
@@ -1018,7 +1023,7 @@ static void cv18xx_sdhci_reset(struct sdhci_host *host, u8 mask)
10181023
struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host);
10191024
u32 val, emmc_caps = MMC_CAP2_NO_SD | MMC_CAP2_NO_SDIO;
10201025

1021-
sdhci_reset(host, mask);
1026+
dwcmshc_reset(host, mask);
10221027

10231028
if ((host->mmc->caps2 & emmc_caps) == emmc_caps) {
10241029
val = sdhci_readl(host, priv->vendor_specific_area1 + CV18XX_SDHCI_MSHC_CTRL);
@@ -1090,7 +1095,7 @@ static void cv18xx_sdhci_post_tuning(struct sdhci_host *host)
10901095
val |= SDHCI_INT_DATA_AVAIL;
10911096
sdhci_writel(host, val, SDHCI_INT_STATUS);
10921097

1093-
sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
1098+
dwcmshc_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
10941099
}
10951100

10961101
static int cv18xx_sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
@@ -1637,7 +1642,7 @@ static const struct sdhci_ops sdhci_dwcmshc_ops = {
16371642
.set_bus_width = sdhci_set_bus_width,
16381643
.set_uhs_signaling = dwcmshc_set_uhs_signaling,
16391644
.get_max_clock = dwcmshc_get_max_clock,
1640-
.reset = sdhci_reset,
1645+
.reset = dwcmshc_reset,
16411646
.adma_write_desc = dwcmshc_adma_write_desc,
16421647
.irq = dwcmshc_cqe_irq_handler,
16431648
};

0 commit comments

Comments
 (0)