[PATCH 24/27] mmc: dw_mmc-rockchip: Keep RK3572 NVM domain powered

Cunhao Lu via B4 Relay devnull+1579567540.qq.com at kernel.org
Wed Oct 21 09:11:21 PDT 2026


From: Cunhao Lu <1579567540 at qq.com>

Power cycling the RK3572 NVM domain causes repeated SD recovery. Keep it
powered during runtime suspend without disabling controller runtime PM.

Signed-off-by: Cunhao Lu <1579567540 at qq.com>
---
 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 },
 	{},

-- 
2.34.1





More information about the Linux-rockchip mailing list