Re: [PATCH 24/27] mmc: dw_mmc-rockchip: Keep RK3572 NVM domain powered
From: Shawn Lin
Date: Mon Oct 26 2026 - 20:53:46 EST
Hi Cunhao,
在 2026/10/22 星期四 0:11, Cunhao Lu via B4 Relay 写道:
From: Cunhao Lu <1579567540@xxxxxx>
Power cycling the RK3572 NVM domain causes repeated SD recovery. Keep it
powered during runtime suspend without disabling controller runtime PM.
Before your v2 about this path, I would like to ask why you need this?
The dw_mmc-rockchip controller is always under A power domain on every
SoC, none of the predecessors need this kind of change. If you see
some errors during RPM, perhaps you should have a look[1] and check your
DTS.
[1] https://lore.kernel.org/linux-mmc/1768524932-163929-1-git-send-email-shawn.lin@xxxxxxxxxxxxxx/
Signed-off-by: Cunhao Lu <1579567540@xxxxxx>
---
drivers/mmc/host/dw_mmc-rockchip.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index 75c82ff20f177..8bc55d4b996c6 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -10,6 +10,7 @@
#include <linux/mmc/host.h>
#include <linux/of_address.h>
#include <linux/mmc/slot-gpio.h>
+#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
@@ -528,6 +529,19 @@ static int dw_mci_rockchip_init(struct dw_mci *host)
return 0;
}
+static int dw_mci_rk3572_init(struct dw_mci *host)
+{
+ int ret;
+
+ /* Power cycling the NVM domain disrupts SDMMC recovery. */
+ ret = dev_pm_genpd_rpm_always_on(host->dev, true);
+ if (ret && ret != -EOPNOTSUPP)
+ dev_warn(host->dev, "failed to keep power domain on: %pe\n",
+ ERR_PTR(ret));
+
+ return dw_mci_rockchip_init(host);
+}
+
static const struct dw_mci_drv_data rk2928_drv_data = {
.init = dw_mci_rockchip_init,
.parse_dt = dw_mci_rk2928_parse_dt,
@@ -541,6 +555,14 @@ static const struct dw_mci_drv_data rk3288_drv_data = {
.init = dw_mci_rockchip_init,
};
+static const struct dw_mci_drv_data rk3572_drv_data = {
+ .common_caps = MMC_CAP_CMD23,
+ .set_ios = dw_mci_rk3288_set_ios,
+ .execute_tuning = dw_mci_rk3288_execute_tuning,
+ .parse_dt = dw_mci_rk3576_parse_dt,
+ .init = dw_mci_rk3572_init,
+};
+
static const struct dw_mci_drv_data rk3576_drv_data = {
.common_caps = MMC_CAP_CMD23,
.set_ios = dw_mci_rk3288_set_ios,
@@ -554,6 +576,8 @@ static const struct of_device_id dw_mci_rockchip_match[] = {
.data = &rk2928_drv_data },
{ .compatible = "rockchip,rk3288-dw-mshc",
.data = &rk3288_drv_data },
+ { .compatible = "rockchip,rk3572-dw-mshc",
+ .data = &rk3572_drv_data },
{ .compatible = "rockchip,rk3576-dw-mshc",
.data = &rk3576_drv_data },
{},