Skip to content

Commit 4331989

Browse files
committed
Merge tag 'mmc-v6.18-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fix from Ulf Hansson: - sdhci-of-dwcmshc: Fix reset handling for some variants * tag 'mmc-v6.18-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-of-dwcmshc: Promote the th1520 reset handling to ip level
2 parents f849f26 + 7475287 commit 4331989

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
@@ -289,6 +289,19 @@ static void dwcmshc_adma_write_desc(struct sdhci_host *host, void **desc,
289289
sdhci_adma_write_desc(host, desc, addr, len, cmd);
290290
}
291291

292+
static void dwcmshc_reset(struct sdhci_host *host, u8 mask)
293+
{
294+
sdhci_reset(host, mask);
295+
296+
/* The dwcmshc does not comply with the SDHCI specification
297+
* regarding the "Software Reset for CMD line should clear 'Command
298+
* Complete' in the Normal Interrupt Status Register." Clear the bit
299+
* here to compensate for this quirk.
300+
*/
301+
if (mask & SDHCI_RESET_CMD)
302+
sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
303+
}
304+
292305
static unsigned int dwcmshc_get_max_clock(struct sdhci_host *host)
293306
{
294307
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -832,15 +845,7 @@ static void th1520_sdhci_reset(struct sdhci_host *host, u8 mask)
832845
struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host);
833846
u16 ctrl_2;
834847

835-
sdhci_reset(host, mask);
836-
837-
/* The T-Head 1520 SoC does not comply with the SDHCI specification
838-
* regarding the "Software Reset for CMD line should clear 'Command
839-
* Complete' in the Normal Interrupt Status Register." Clear the bit
840-
* here to compensate for this quirk.
841-
*/
842-
if (mask & SDHCI_RESET_CMD)
843-
sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
848+
dwcmshc_reset(host, mask);
844849

845850
if (priv->flags & FLAG_IO_FIXED_1V8) {
846851
ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
@@ -886,7 +891,7 @@ static void cv18xx_sdhci_reset(struct sdhci_host *host, u8 mask)
886891
struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host);
887892
u32 val, emmc_caps = MMC_CAP2_NO_SD | MMC_CAP2_NO_SDIO;
888893

889-
sdhci_reset(host, mask);
894+
dwcmshc_reset(host, mask);
890895

891896
if ((host->mmc->caps2 & emmc_caps) == emmc_caps) {
892897
val = sdhci_readl(host, priv->vendor_specific_area1 + CV18XX_SDHCI_MSHC_CTRL);
@@ -958,7 +963,7 @@ static void cv18xx_sdhci_post_tuning(struct sdhci_host *host)
958963
val |= SDHCI_INT_DATA_AVAIL;
959964
sdhci_writel(host, val, SDHCI_INT_STATUS);
960965

961-
sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
966+
dwcmshc_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
962967
}
963968

964969
static int cv18xx_sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
@@ -1100,7 +1105,7 @@ static const struct sdhci_ops sdhci_dwcmshc_ops = {
11001105
.set_bus_width = sdhci_set_bus_width,
11011106
.set_uhs_signaling = dwcmshc_set_uhs_signaling,
11021107
.get_max_clock = dwcmshc_get_max_clock,
1103-
.reset = sdhci_reset,
1108+
.reset = dwcmshc_reset,
11041109
.adma_write_desc = dwcmshc_adma_write_desc,
11051110
.irq = dwcmshc_cqe_irq_handler,
11061111
};

0 commit comments

Comments
 (0)