Skip to contentSkip to conversation

mmc: meson-gx: Add reset for Response Mode Error Mask (RMEM)

PATCH In review Rong Chen 2 participants 2 messages Nov 20 – Nov 30

Subsystems (2)
lore
Share & tools
lore

Rong Chen

author
#0 lore raw

PATCH 1/1 mmc: meson-gx: Add reset for Response Mode Error Mask (RMEM)

For T7 and older SoC families, the RMEM has no effect. Starting from the SoC family A4, RMEM acts as an interrupt mask for the device status field received in R1/R1b responses.

By setting RMEM to zero, the device status is ignored, thereby preventing controller hangs caused by spurious IRQs under specific device states.

---
 drivers/mmc/host/meson-gx-mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/meson-gx-mmc.c +4 -0
index 49df33bbd8e5..9d9b00b199b6 100644
@@ -113,6 +113,7 @@
 #define SD_EMMC_CMD_RSP1 0x60
 #define SD_EMMC_CMD_RSP2 0x64
 #define SD_EMMC_CMD_RSP3 0x68
+#define SD_EMMC_CMD_RMEM 0x150
 
 #define SD_EMMC_RXD 0x94
 #define SD_EMMC_TXD 0x94
@@ -1086,6 +1087,9 @@ static void meson_mmc_cfg_init(struct meson_host *host)
 	cfg |= CFG_ERR_ABORT;
 
 	writel(cfg, host->regs + SD_EMMC_CFG);
+
+	/* ignore status in response */
+	writel(0x0, host->regs + SD_EMMC_CMD_RMEM);
 }
 
 static int meson_mmc_card_busy(struct mmc_host *mmc)

---
base-commit: d2616724e01132376c78872b8324f38659af9f28
change-id: 20261120-a4_mmc-dd4b9b36cb00

Best regards,

Signature · 1 line
Rong Chen <[email protected]>
#1 lore raw
Quoted 10 lines · On Fri, Nov 20, 2026 at 6:53 AM Rong Chen via B4 Relay…

From: Rong Chen <[email protected]>

For T7 and older SoC families, the RMEM has no effect. Starting from the SoC family A4, RMEM acts as an interrupt mask for the device status field received in R1/R1b responses.

By setting RMEM to zero, the device status is ignored, thereby preventing controller hangs caused by spurious IRQs under specific device states.

Is this a fix or just something that seems like the right thing to do?

If a fix, should it be tagged for stable kernels?

Kind regards
Uffe

Quoted 38 lines
---
 drivers/mmc/host/meson-gx-mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/meson-gx-mmc.c +4 -1
index 49df33bbd8e5..9d9b00b199b6 100644
@@ -113,6 +113,7 @@
 #define SD_EMMC_CMD_RSP1 0x60
 #define SD_EMMC_CMD_RSP2 0x64
 #define SD_EMMC_CMD_RSP3 0x68
+#define SD_EMMC_CMD_RMEM 0x150
 
 #define SD_EMMC_RXD 0x94
 #define SD_EMMC_TXD 0x94
@@ -1086,6 +1087,9 @@ static void meson_mmc_cfg_init(struct meson_host *host)
        cfg |= CFG_ERR_ABORT;
 
        writel(cfg, host->regs + SD_EMMC_CFG);
+
+       /* ignore status in response */
+       writel(0x0, host->regs + SD_EMMC_CMD_RMEM);
 }
 
 static int meson_mmc_card_busy(struct mmc_host *mmc)
 
---

base-commit: d2616724e01132376c78872b8324f38659af9f28
change-id: 20261120-a4_mmc-dd4b9b36cb00

Best regards,
--
Rong Chen <[email protected]>